@@ -1740,7 +1740,7 @@ static void pcpu_alloc_tag_free_hook(struct pcpu_chunk *chunk, int off, size_t s
1740
1740
* RETURNS:
1741
1741
* Percpu pointer to the allocated area on success, NULL on failure.
1742
1742
*/
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 ,
1744
1744
gfp_t gfp )
1745
1745
{
1746
1746
gfp_t pcpu_gfp ;
@@ -1907,6 +1907,8 @@ static void __percpu *pcpu_alloc(size_t size, size_t align, bool reserved,
1907
1907
1908
1908
pcpu_memcg_post_alloc_hook (objcg , chunk , off , size );
1909
1909
1910
+ pcpu_alloc_tag_alloc_hook (chunk , off , size );
1911
+
1910
1912
return ptr ;
1911
1913
1912
1914
fail_unlock :
@@ -1935,61 +1937,7 @@ static void __percpu *pcpu_alloc(size_t size, size_t align, bool reserved,
1935
1937
1936
1938
return NULL ;
1937
1939
}
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 );
1993
1941
1994
1942
/**
1995
1943
* pcpu_balance_free - manage the amount of free chunks
@@ -2328,6 +2276,8 @@ void free_percpu(void __percpu *ptr)
2328
2276
spin_lock_irqsave (& pcpu_lock , flags );
2329
2277
size = pcpu_free_area (chunk , off );
2330
2278
2279
+ pcpu_alloc_tag_free_hook (chunk , off , size );
2280
+
2331
2281
pcpu_memcg_free_hook (chunk , off , size );
2332
2282
2333
2283
/*
0 commit comments