@@ -1740,7 +1740,7 @@ static void pcpu_alloc_tag_free_hook(struct pcpu_chunk *chunk, int off, size_t s
17401740 * RETURNS:
17411741 * Percpu pointer to the allocated area on success, NULL on failure.
17421742 */
1743- static void __percpu * pcpu_alloc (size_t size , size_t align , bool reserved ,
1743+ void __percpu * pcpu_alloc_noprof (size_t size , size_t align , bool reserved ,
17441744 gfp_t gfp )
17451745{
17461746 gfp_t pcpu_gfp ;
@@ -1907,6 +1907,8 @@ static void __percpu *pcpu_alloc(size_t size, size_t align, bool reserved,
19071907
19081908 pcpu_memcg_post_alloc_hook (objcg , chunk , off , size );
19091909
1910+ pcpu_alloc_tag_alloc_hook (chunk , off , size );
1911+
19101912 return ptr ;
19111913
19121914fail_unlock :
@@ -1935,61 +1937,7 @@ static void __percpu *pcpu_alloc(size_t size, size_t align, bool reserved,
19351937
19361938 return NULL ;
19371939}
1938-
1939- /**
1940- * __alloc_percpu_gfp - allocate dynamic percpu area
1941- * @size: size of area to allocate in bytes
1942- * @align: alignment of area (max PAGE_SIZE)
1943- * @gfp: allocation flags
1944- *
1945- * Allocate zero-filled percpu area of @size bytes aligned at @align. If
1946- * @gfp doesn't contain %GFP_KERNEL, the allocation doesn't block and can
1947- * be called from any context but is a lot more likely to fail. If @gfp
1948- * has __GFP_NOWARN then no warning will be triggered on invalid or failed
1949- * allocation requests.
1950- *
1951- * RETURNS:
1952- * Percpu pointer to the allocated area on success, NULL on failure.
1953- */
1954- void __percpu * __alloc_percpu_gfp (size_t size , size_t align , gfp_t gfp )
1955- {
1956- return pcpu_alloc (size , align , false, gfp );
1957- }
1958- EXPORT_SYMBOL_GPL (__alloc_percpu_gfp );
1959-
1960- /**
1961- * __alloc_percpu - allocate dynamic percpu area
1962- * @size: size of area to allocate in bytes
1963- * @align: alignment of area (max PAGE_SIZE)
1964- *
1965- * Equivalent to __alloc_percpu_gfp(size, align, %GFP_KERNEL).
1966- */
1967- void __percpu * __alloc_percpu (size_t size , size_t align )
1968- {
1969- return pcpu_alloc (size , align , false, GFP_KERNEL );
1970- }
1971- EXPORT_SYMBOL_GPL (__alloc_percpu );
1972-
1973- /**
1974- * __alloc_reserved_percpu - allocate reserved percpu area
1975- * @size: size of area to allocate in bytes
1976- * @align: alignment of area (max PAGE_SIZE)
1977- *
1978- * Allocate zero-filled percpu area of @size bytes aligned at @align
1979- * from reserved percpu area if arch has set it up; otherwise,
1980- * allocation is served from the same dynamic area. Might sleep.
1981- * Might trigger writeouts.
1982- *
1983- * CONTEXT:
1984- * Does GFP_KERNEL allocation.
1985- *
1986- * RETURNS:
1987- * Percpu pointer to the allocated area on success, NULL on failure.
1988- */
1989- void __percpu * __alloc_reserved_percpu (size_t size , size_t align )
1990- {
1991- return pcpu_alloc (size , align , true, GFP_KERNEL );
1992- }
1940+ EXPORT_SYMBOL_GPL (pcpu_alloc_noprof );
19931941
19941942/**
19951943 * pcpu_balance_free - manage the amount of free chunks
@@ -2328,6 +2276,8 @@ void free_percpu(void __percpu *ptr)
23282276 spin_lock_irqsave (& pcpu_lock , flags );
23292277 size = pcpu_free_area (chunk , off );
23302278
2279+ pcpu_alloc_tag_free_hook (chunk , off , size );
2280+
23312281 pcpu_memcg_free_hook (chunk , off , size );
23322282
23332283 /*
0 commit comments