public inbox for linux-next@vger.kernel.org
 help / color / mirror / Atom feed
* linux-next: manual merge of the net-next tree with the mm tree
@ 2024-04-29  1:43 Stephen Rothwell
  2024-04-29  2:33 ` Stephen Rothwell
  2024-05-15 22:51 ` Stephen Rothwell
  0 siblings, 2 replies; 4+ messages in thread
From: Stephen Rothwell @ 2024-04-29  1:43 UTC (permalink / raw)
  To: David Miller, Jakub Kicinski, Paolo Abeni, Andrew Morton
  Cc: Networking, Alexander Lobakin, Kent Overstreet,
	Linux Kernel Mailing List, Linux Next Mailing List, Randy Dunlap,
	Suren Baghdasaryan, Tony Nguyen

[-- Attachment #1: Type: text/plain, Size: 5029 bytes --]

Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

  include/linux/slab.h

between commit:

  7bd230a26648 ("mm/slab: enable slab allocation tagging for kmalloc and friends")

from the mm_unstable branch of the mm tree and commit:

  a1d6063d9f2f ("slab: introduce kvmalloc_array_node() and kvcalloc_node()")

from the net-next tree.

I fixed it up (maybe? see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc include/linux/slab.h
index 4cc37ef22aae,d1d1fa5e7983..000000000000
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@@ -773,40 -744,66 +773,47 @@@ static inline __alloc_size(1, 2) void *
   * @size: how many bytes of memory are required.
   * @flags: the type of memory to allocate (see kmalloc).
   */
 -static inline __alloc_size(1) void *kzalloc(size_t size, gfp_t flags)
 +static inline __alloc_size(1) void *kzalloc_noprof(size_t size, gfp_t flags)
  {
 -	return kmalloc(size, flags | __GFP_ZERO);
 +	return kmalloc_noprof(size, flags | __GFP_ZERO);
  }
 +#define kzalloc(...)				alloc_hooks(kzalloc_noprof(__VA_ARGS__))
 +#define kzalloc_node(_size, _flags, _node)	kmalloc_node(_size, (_flags)|__GFP_ZERO, _node)
  
 -/**
 - * kzalloc_node - allocate zeroed memory from a particular memory node.
 - * @size: how many bytes of memory are required.
 - * @flags: the type of memory to allocate (see kmalloc).
 - * @node: memory node from which to allocate
 - */
 -static inline __alloc_size(1) void *kzalloc_node(size_t size, gfp_t flags, int node)
 -{
 -	return kmalloc_node(size, flags | __GFP_ZERO, node);
 -}
 +extern void *kvmalloc_node_noprof(size_t size, gfp_t flags, int node) __alloc_size(1);
 +#define kvmalloc_node(...)			alloc_hooks(kvmalloc_node_noprof(__VA_ARGS__))
  
 -extern void *kvmalloc_node(size_t size, gfp_t flags, int node) __alloc_size(1);
 -static inline __alloc_size(1) void *kvmalloc(size_t size, gfp_t flags)
 -{
 -	return kvmalloc_node(size, flags, NUMA_NO_NODE);
 -}
 -static inline __alloc_size(1) void *kvzalloc_node(size_t size, gfp_t flags, int node)
 -{
 -	return kvmalloc_node(size, flags | __GFP_ZERO, node);
 -}
 -static inline __alloc_size(1) void *kvzalloc(size_t size, gfp_t flags)
 -{
 -	return kvmalloc(size, flags | __GFP_ZERO);
 -}
 +#define kvmalloc(_size, _flags)			kvmalloc_node(_size, _flags, NUMA_NO_NODE)
 +#define kvmalloc_noprof(_size, _flags)		kvmalloc_node_noprof(_size, _flags, NUMA_NO_NODE)
 +#define kvzalloc(_size, _flags)			kvmalloc(_size, _flags|__GFP_ZERO)
  
 -static inline __alloc_size(1, 2) void *
 -kvmalloc_array_node(size_t n, size_t size, gfp_t flags, int node)
 +#define kvzalloc_node(_size, _flags, _node)	kvmalloc_node(_size, _flags|__GFP_ZERO, _node)
 +
- static inline __alloc_size(1, 2) void *kvmalloc_array_noprof(size_t n, size_t size, gfp_t flags)
++static inline __alloc_size(1, 2) void *kvmalloc_array_node_noprof(size_t n, size_t size, gfp_t flags)
  {
  	size_t bytes;
  
  	if (unlikely(check_mul_overflow(n, size, &bytes)))
  		return NULL;
  
 -	return kvmalloc_node(bytes, flags, node);
 -}
 -
 -static inline __alloc_size(1, 2) void *
 -kvmalloc_array(size_t n, size_t size, gfp_t flags)
 -{
 -	return kvmalloc_array_node(n, size, flags, NUMA_NO_NODE);
 +	return kvmalloc_node_noprof(bytes, flags, NUMA_NO_NODE);
  }
  
- #define kvmalloc_array(...)			alloc_hooks(kvmalloc_array_noprof(__VA_ARGS__))
+ static inline __alloc_size(1, 2) void *
+ kvcalloc_node(size_t n, size_t size, gfp_t flags, int node)
+ {
 -	return kvmalloc_array_node(n, size, flags | __GFP_ZERO, node);
++	return kvmalloc_array_node_noprof(n, size, flags | __GFP_ZERO, node);
+ }
+ 
 -static inline __alloc_size(1, 2) void *kvcalloc(size_t n, size_t size, gfp_t flags)
 -{
 -	return kvmalloc_array(n, size, flags | __GFP_ZERO);
 -}
++#define kvmalloc_array(...)			alloc_hooks(kvmalloc_array_node_noprof(__VA_ARGS__))
++#define kvmalloc_array_noprof(_n, _size, _flags))	kvmalloc_array(_n, _size, _flags)
 +#define kvcalloc(_n, _size, _flags)		kvmalloc_array(_n, _size, _flags|__GFP_ZERO)
- #define kvcalloc_noprof(_n, _size, _flags)	kvmalloc_array_noprof(_n, _size, _flags|__GFP_ZERO)
++#define kvcalloc_noprof(_n, _size, _flags)	kvmalloc_array_node_noprof(_n, _size, _flags|__GFP_ZERO)
  
 -extern void *kvrealloc(const void *p, size_t oldsize, size_t newsize, gfp_t flags)
 +extern void *kvrealloc_noprof(const void *p, size_t oldsize, size_t newsize, gfp_t flags)
  		      __realloc_size(3);
 +#define kvrealloc(...)				alloc_hooks(kvrealloc_noprof(__VA_ARGS__))
 +
  extern void kvfree(const void *addr);
  DEFINE_FREE(kvfree, void *, if (_T) kvfree(_T))
  

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: linux-next: manual merge of the net-next tree with the mm tree
  2024-04-29  1:43 linux-next: manual merge of the net-next tree with the mm tree Stephen Rothwell
@ 2024-04-29  2:33 ` Stephen Rothwell
  2024-05-15 22:51 ` Stephen Rothwell
  1 sibling, 0 replies; 4+ messages in thread
From: Stephen Rothwell @ 2024-04-29  2:33 UTC (permalink / raw)
  To: David Miller, Jakub Kicinski, Paolo Abeni, Andrew Morton
  Cc: Networking, Alexander Lobakin, Kent Overstreet,
	Linux Kernel Mailing List, Linux Next Mailing List, Randy Dunlap,
	Suren Baghdasaryan, Tony Nguyen

[-- Attachment #1: Type: text/plain, Size: 5251 bytes --]

Hi all,

On Mon, 29 Apr 2024 11:43:02 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> Today's linux-next merge of the net-next tree got a conflict in:
> 
>   include/linux/slab.h
> 
> between commit:
> 
>   7bd230a26648 ("mm/slab: enable slab allocation tagging for kmalloc and friends")
> 
> from the mm_unstable branch of the mm tree and commit:
> 
>   a1d6063d9f2f ("slab: introduce kvmalloc_array_node() and kvcalloc_node()")
> 
> from the net-next tree.
> 
> I fixed it up (maybe? see below) and can carry the fix as necessary. This
> is now fixed as far as linux-next is concerned, but any non trivial
> conflicts should be mentioned to your upstream maintainer when your tree
> is submitted for merging.  You may also want to consider cooperating
> with the maintainer of the conflicting tree to minimise any particularly
> complex conflicts.

I tried again, see below.
-- 
Cheers,
Stephen Rothwell

diff --cc include/linux/slab.h
index 4cc37ef22aae,d1d1fa5e7983..88426b015faa
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@@ -773,40 -744,66 +773,54 @@@ static inline __alloc_size(1, 2) void *
   * @size: how many bytes of memory are required.
   * @flags: the type of memory to allocate (see kmalloc).
   */
 -static inline __alloc_size(1) void *kzalloc(size_t size, gfp_t flags)
 +static inline __alloc_size(1) void *kzalloc_noprof(size_t size, gfp_t flags)
  {
 -	return kmalloc(size, flags | __GFP_ZERO);
 +	return kmalloc_noprof(size, flags | __GFP_ZERO);
  }
 +#define kzalloc(...)				alloc_hooks(kzalloc_noprof(__VA_ARGS__))
 +#define kzalloc_node(_size, _flags, _node)	kmalloc_node(_size, (_flags)|__GFP_ZERO, _node)
  
 -/**
 - * kzalloc_node - allocate zeroed memory from a particular memory node.
 - * @size: how many bytes of memory are required.
 - * @flags: the type of memory to allocate (see kmalloc).
 - * @node: memory node from which to allocate
 - */
 -static inline __alloc_size(1) void *kzalloc_node(size_t size, gfp_t flags, int node)
 -{
 -	return kmalloc_node(size, flags | __GFP_ZERO, node);
 -}
 +extern void *kvmalloc_node_noprof(size_t size, gfp_t flags, int node) __alloc_size(1);
 +#define kvmalloc_node(...)			alloc_hooks(kvmalloc_node_noprof(__VA_ARGS__))
  
 -extern void *kvmalloc_node(size_t size, gfp_t flags, int node) __alloc_size(1);
 -static inline __alloc_size(1) void *kvmalloc(size_t size, gfp_t flags)
 -{
 -	return kvmalloc_node(size, flags, NUMA_NO_NODE);
 -}
 -static inline __alloc_size(1) void *kvzalloc_node(size_t size, gfp_t flags, int node)
 -{
 -	return kvmalloc_node(size, flags | __GFP_ZERO, node);
 -}
 -static inline __alloc_size(1) void *kvzalloc(size_t size, gfp_t flags)
 -{
 -	return kvmalloc(size, flags | __GFP_ZERO);
 -}
 +#define kvmalloc(_size, _flags)			kvmalloc_node(_size, _flags, NUMA_NO_NODE)
 +#define kvmalloc_noprof(_size, _flags)		kvmalloc_node_noprof(_size, _flags, NUMA_NO_NODE)
 +#define kvzalloc(_size, _flags)			kvmalloc(_size, _flags|__GFP_ZERO)
  
 -static inline __alloc_size(1, 2) void *
 -kvmalloc_array_node(size_t n, size_t size, gfp_t flags, int node)
 +#define kvzalloc_node(_size, _flags, _node)	kvmalloc_node(_size, _flags|__GFP_ZERO, _node)
 +
- static inline __alloc_size(1, 2) void *kvmalloc_array_noprof(size_t n, size_t size, gfp_t flags)
++static inline __alloc_size(1, 2) void *kvmalloc_array_node_noprof(size_t n, size_t size, gfp_t flags, int node)
  {
  	size_t bytes;
  
  	if (unlikely(check_mul_overflow(n, size, &bytes)))
  		return NULL;
  
- 	return kvmalloc_node_noprof(bytes, flags, NUMA_NO_NODE);
 -	return kvmalloc_node(bytes, flags, node);
++	return kvmalloc_node_noprof(bytes, flags, node);
+ }
+ 
++#define kvmalloc_array_node(...)	alloc_hooks(kvmalloc_array_node_noprof(__VA_ARGS__))
++
+ static inline __alloc_size(1, 2) void *
+ kvmalloc_array(size_t n, size_t size, gfp_t flags)
+ {
+ 	return kvmalloc_array_node(n, size, flags, NUMA_NO_NODE);
+ }
++#define kvmalloc_array_noprof(_n, _size, _flags)	kvmalloc_array(_n, _size, _flags)
+ 
+ static inline __alloc_size(1, 2) void *
+ kvcalloc_node(size_t n, size_t size, gfp_t flags, int node)
+ {
 -	return kvmalloc_array_node(n, size, flags | __GFP_ZERO, node);
++	return kvmalloc_array_node_noprof(n, size, flags | __GFP_ZERO, node);
  }
  
- #define kvmalloc_array(...)			alloc_hooks(kvmalloc_array_noprof(__VA_ARGS__))
 -static inline __alloc_size(1, 2) void *kvcalloc(size_t n, size_t size, gfp_t flags)
 -{
 -	return kvmalloc_array(n, size, flags | __GFP_ZERO);
 -}
 +#define kvcalloc(_n, _size, _flags)		kvmalloc_array(_n, _size, _flags|__GFP_ZERO)
- #define kvcalloc_noprof(_n, _size, _flags)	kvmalloc_array_noprof(_n, _size, _flags|__GFP_ZERO)
++#define kvcalloc_noprof(_n, _size, _flags)	kvmalloc_array_node_noprof(_n, _size, _flags|__GFP_ZERO)
  
 -extern void *kvrealloc(const void *p, size_t oldsize, size_t newsize, gfp_t flags)
 +extern void *kvrealloc_noprof(const void *p, size_t oldsize, size_t newsize, gfp_t flags)
  		      __realloc_size(3);
 +#define kvrealloc(...)				alloc_hooks(kvrealloc_noprof(__VA_ARGS__))
 +
  extern void kvfree(const void *addr);
  DEFINE_FREE(kvfree, void *, if (_T) kvfree(_T))
  

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: linux-next: manual merge of the net-next tree with the mm tree
  2024-04-29  1:43 linux-next: manual merge of the net-next tree with the mm tree Stephen Rothwell
  2024-04-29  2:33 ` Stephen Rothwell
@ 2024-05-15 22:51 ` Stephen Rothwell
  2024-05-15 22:55   ` Stephen Rothwell
  1 sibling, 1 reply; 4+ messages in thread
From: Stephen Rothwell @ 2024-05-15 22:51 UTC (permalink / raw)
  To: Andrew Morton
  Cc: David Miller, Jakub Kicinski, Paolo Abeni, Networking,
	Alexander Lobakin, Kent Overstreet, Linux Kernel Mailing List,
	Linux Next Mailing List, Randy Dunlap, Suren Baghdasaryan,
	Tony Nguyen

[-- Attachment #1: Type: text/plain, Size: 5421 bytes --]

Hi all,

On Mon, 29 Apr 2024 11:43:02 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> Today's linux-next merge of the net-next tree got a conflict in:
> 
>   include/linux/slab.h
> 
> between commit:
> 
>   7bd230a26648 ("mm/slab: enable slab allocation tagging for kmalloc and friends")
> 
> from the mm_unstable branch of the mm tree and commit:
> 
>   a1d6063d9f2f ("slab: introduce kvmalloc_array_node() and kvcalloc_node()")
> 
> from the net-next tree.
> 
> I fixed it up (maybe? see below) and can carry the fix as necessary. This
> is now fixed as far as linux-next is concerned, but any non trivial
> conflicts should be mentioned to your upstream maintainer when your tree
> is submitted for merging.  You may also want to consider cooperating
> with the maintainer of the conflicting tree to minimise any particularly
> complex conflicts.
> 
> 
> diff --cc include/linux/slab.h
> index 4cc37ef22aae,d1d1fa5e7983..000000000000
> --- a/include/linux/slab.h
> +++ b/include/linux/slab.h
> @@@ -773,40 -744,66 +773,47 @@@ static inline __alloc_size(1, 2) void *
>    * @size: how many bytes of memory are required.
>    * @flags: the type of memory to allocate (see kmalloc).
>    */
>  -static inline __alloc_size(1) void *kzalloc(size_t size, gfp_t flags)
>  +static inline __alloc_size(1) void *kzalloc_noprof(size_t size, gfp_t flags)
>   {
>  -	return kmalloc(size, flags | __GFP_ZERO);
>  +	return kmalloc_noprof(size, flags | __GFP_ZERO);
>   }
>  +#define kzalloc(...)				alloc_hooks(kzalloc_noprof(__VA_ARGS__))
>  +#define kzalloc_node(_size, _flags, _node)	kmalloc_node(_size, (_flags)|__GFP_ZERO, _node)
>   
>  -/**
>  - * kzalloc_node - allocate zeroed memory from a particular memory node.
>  - * @size: how many bytes of memory are required.
>  - * @flags: the type of memory to allocate (see kmalloc).
>  - * @node: memory node from which to allocate
>  - */
>  -static inline __alloc_size(1) void *kzalloc_node(size_t size, gfp_t flags, int node)
>  -{
>  -	return kmalloc_node(size, flags | __GFP_ZERO, node);
>  -}
>  +extern void *kvmalloc_node_noprof(size_t size, gfp_t flags, int node) __alloc_size(1);
>  +#define kvmalloc_node(...)			alloc_hooks(kvmalloc_node_noprof(__VA_ARGS__))
>   
>  -extern void *kvmalloc_node(size_t size, gfp_t flags, int node) __alloc_size(1);
>  -static inline __alloc_size(1) void *kvmalloc(size_t size, gfp_t flags)
>  -{
>  -	return kvmalloc_node(size, flags, NUMA_NO_NODE);
>  -}
>  -static inline __alloc_size(1) void *kvzalloc_node(size_t size, gfp_t flags, int node)
>  -{
>  -	return kvmalloc_node(size, flags | __GFP_ZERO, node);
>  -}
>  -static inline __alloc_size(1) void *kvzalloc(size_t size, gfp_t flags)
>  -{
>  -	return kvmalloc(size, flags | __GFP_ZERO);
>  -}
>  +#define kvmalloc(_size, _flags)			kvmalloc_node(_size, _flags, NUMA_NO_NODE)
>  +#define kvmalloc_noprof(_size, _flags)		kvmalloc_node_noprof(_size, _flags, NUMA_NO_NODE)
>  +#define kvzalloc(_size, _flags)			kvmalloc(_size, _flags|__GFP_ZERO)
>   
>  -static inline __alloc_size(1, 2) void *
>  -kvmalloc_array_node(size_t n, size_t size, gfp_t flags, int node)
>  +#define kvzalloc_node(_size, _flags, _node)	kvmalloc_node(_size, _flags|__GFP_ZERO, _node)
>  +
> - static inline __alloc_size(1, 2) void *kvmalloc_array_noprof(size_t n, size_t size, gfp_t flags)
> ++static inline __alloc_size(1, 2) void *kvmalloc_array_node_noprof(size_t n, size_t size, gfp_t flags)
>   {
>   	size_t bytes;
>   
>   	if (unlikely(check_mul_overflow(n, size, &bytes)))
>   		return NULL;
>   
>  -	return kvmalloc_node(bytes, flags, node);
>  -}
>  -
>  -static inline __alloc_size(1, 2) void *
>  -kvmalloc_array(size_t n, size_t size, gfp_t flags)
>  -{
>  -	return kvmalloc_array_node(n, size, flags, NUMA_NO_NODE);
>  +	return kvmalloc_node_noprof(bytes, flags, NUMA_NO_NODE);
>   }
>   
> - #define kvmalloc_array(...)			alloc_hooks(kvmalloc_array_noprof(__VA_ARGS__))
> + static inline __alloc_size(1, 2) void *
> + kvcalloc_node(size_t n, size_t size, gfp_t flags, int node)
> + {
>  -	return kvmalloc_array_node(n, size, flags | __GFP_ZERO, node);
> ++	return kvmalloc_array_node_noprof(n, size, flags | __GFP_ZERO, node);
> + }
> + 
>  -static inline __alloc_size(1, 2) void *kvcalloc(size_t n, size_t size, gfp_t flags)
>  -{
>  -	return kvmalloc_array(n, size, flags | __GFP_ZERO);
>  -}
> ++#define kvmalloc_array(...)			alloc_hooks(kvmalloc_array_node_noprof(__VA_ARGS__))
> ++#define kvmalloc_array_noprof(_n, _size, _flags))	kvmalloc_array(_n, _size, _flags)
>  +#define kvcalloc(_n, _size, _flags)		kvmalloc_array(_n, _size, _flags|__GFP_ZERO)
> - #define kvcalloc_noprof(_n, _size, _flags)	kvmalloc_array_noprof(_n, _size, _flags|__GFP_ZERO)
> ++#define kvcalloc_noprof(_n, _size, _flags)	kvmalloc_array_node_noprof(_n, _size, _flags|__GFP_ZERO)
>   
>  -extern void *kvrealloc(const void *p, size_t oldsize, size_t newsize, gfp_t flags)
>  +extern void *kvrealloc_noprof(const void *p, size_t oldsize, size_t newsize, gfp_t flags)
>   		      __realloc_size(3);
>  +#define kvrealloc(...)				alloc_hooks(kvrealloc_noprof(__VA_ARGS__))
>  +
>   extern void kvfree(const void *addr);
>   DEFINE_FREE(kvfree, void *, if (_T) kvfree(_T))
>   

This is now a conflict between the mm-stable tree and Linus' tree.

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: linux-next: manual merge of the net-next tree with the mm tree
  2024-05-15 22:51 ` Stephen Rothwell
@ 2024-05-15 22:55   ` Stephen Rothwell
  0 siblings, 0 replies; 4+ messages in thread
From: Stephen Rothwell @ 2024-05-15 22:55 UTC (permalink / raw)
  To: Andrew Morton
  Cc: David Miller, Jakub Kicinski, Paolo Abeni, Networking,
	Alexander Lobakin, Kent Overstreet, Linux Kernel Mailing List,
	Linux Next Mailing List, Randy Dunlap, Suren Baghdasaryan,
	Tony Nguyen

[-- Attachment #1: Type: text/plain, Size: 5069 bytes --]

Hi all,

On Thu, 16 May 2024 08:51:40 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> On Mon, 29 Apr 2024 11:43:02 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> >
> > Today's linux-next merge of the net-next tree got a conflict in:
> > 
> >   include/linux/slab.h
> > 
> > between commit:
> > 
> >   7bd230a26648 ("mm/slab: enable slab allocation tagging for kmalloc and friends")
> > 
> > from the mm_unstable branch of the mm tree and commit:
> > 
> >   a1d6063d9f2f ("slab: introduce kvmalloc_array_node() and kvcalloc_node()")
> > 
> > from the net-next tree.
> > 
>
> This is now a conflict between the mm-stable tree and Linus' tree.

But with the revised fixup below, of course.

-- 
Cheers,
Stephen Rothwell

diff --cc include/linux/slab.h
index 4cc37ef22aae,d1d1fa5e7983..88426b015faa
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@@ -773,40 -744,66 +773,54 @@@ static inline __alloc_size(1, 2) void *
   * @size: how many bytes of memory are required.
   * @flags: the type of memory to allocate (see kmalloc).
   */
 -static inline __alloc_size(1) void *kzalloc(size_t size, gfp_t flags)
 +static inline __alloc_size(1) void *kzalloc_noprof(size_t size, gfp_t flags)
  {
 -	return kmalloc(size, flags | __GFP_ZERO);
 +	return kmalloc_noprof(size, flags | __GFP_ZERO);
  }
 +#define kzalloc(...)				alloc_hooks(kzalloc_noprof(__VA_ARGS__))
 +#define kzalloc_node(_size, _flags, _node)	kmalloc_node(_size, (_flags)|__GFP_ZERO, _node)
  
 -/**
 - * kzalloc_node - allocate zeroed memory from a particular memory node.
 - * @size: how many bytes of memory are required.
 - * @flags: the type of memory to allocate (see kmalloc).
 - * @node: memory node from which to allocate
 - */
 -static inline __alloc_size(1) void *kzalloc_node(size_t size, gfp_t flags, int node)
 -{
 -	return kmalloc_node(size, flags | __GFP_ZERO, node);
 -}
 +extern void *kvmalloc_node_noprof(size_t size, gfp_t flags, int node) __alloc_size(1);
 +#define kvmalloc_node(...)			alloc_hooks(kvmalloc_node_noprof(__VA_ARGS__))
  
 -extern void *kvmalloc_node(size_t size, gfp_t flags, int node) __alloc_size(1);
 -static inline __alloc_size(1) void *kvmalloc(size_t size, gfp_t flags)
 -{
 -	return kvmalloc_node(size, flags, NUMA_NO_NODE);
 -}
 -static inline __alloc_size(1) void *kvzalloc_node(size_t size, gfp_t flags, int node)
 -{
 -	return kvmalloc_node(size, flags | __GFP_ZERO, node);
 -}
 -static inline __alloc_size(1) void *kvzalloc(size_t size, gfp_t flags)
 -{
 -	return kvmalloc(size, flags | __GFP_ZERO);
 -}
 +#define kvmalloc(_size, _flags)			kvmalloc_node(_size, _flags, NUMA_NO_NODE)
 +#define kvmalloc_noprof(_size, _flags)		kvmalloc_node_noprof(_size, _flags, NUMA_NO_NODE)
 +#define kvzalloc(_size, _flags)			kvmalloc(_size, _flags|__GFP_ZERO)
  
 -static inline __alloc_size(1, 2) void *
 -kvmalloc_array_node(size_t n, size_t size, gfp_t flags, int node)
 +#define kvzalloc_node(_size, _flags, _node)	kvmalloc_node(_size, _flags|__GFP_ZERO, _node)
 +
- static inline __alloc_size(1, 2) void *kvmalloc_array_noprof(size_t n, size_t size, gfp_t flags)
++static inline __alloc_size(1, 2) void *kvmalloc_array_node_noprof(size_t n, size_t size, gfp_t flags, int node)
  {
  	size_t bytes;
  
  	if (unlikely(check_mul_overflow(n, size, &bytes)))
  		return NULL;
  
- 	return kvmalloc_node_noprof(bytes, flags, NUMA_NO_NODE);
 -	return kvmalloc_node(bytes, flags, node);
++	return kvmalloc_node_noprof(bytes, flags, node);
+ }
+ 
++#define kvmalloc_array_node(...)	alloc_hooks(kvmalloc_array_node_noprof(__VA_ARGS__))
++
+ static inline __alloc_size(1, 2) void *
+ kvmalloc_array(size_t n, size_t size, gfp_t flags)
+ {
+ 	return kvmalloc_array_node(n, size, flags, NUMA_NO_NODE);
+ }
++#define kvmalloc_array_noprof(_n, _size, _flags)	kvmalloc_array(_n, _size, _flags)
+ 
+ static inline __alloc_size(1, 2) void *
+ kvcalloc_node(size_t n, size_t size, gfp_t flags, int node)
+ {
 -	return kvmalloc_array_node(n, size, flags | __GFP_ZERO, node);
++	return kvmalloc_array_node_noprof(n, size, flags | __GFP_ZERO, node);
  }
  
- #define kvmalloc_array(...)			alloc_hooks(kvmalloc_array_noprof(__VA_ARGS__))
 -static inline __alloc_size(1, 2) void *kvcalloc(size_t n, size_t size, gfp_t flags)
 -{
 -	return kvmalloc_array(n, size, flags | __GFP_ZERO);
 -}
 +#define kvcalloc(_n, _size, _flags)		kvmalloc_array(_n, _size, _flags|__GFP_ZERO)
- #define kvcalloc_noprof(_n, _size, _flags)	kvmalloc_array_noprof(_n, _size, _flags|__GFP_ZERO)
++#define kvcalloc_noprof(_n, _size, _flags)	kvmalloc_array_node_noprof(_n, _size, _flags|__GFP_ZERO)
  
 -extern void *kvrealloc(const void *p, size_t oldsize, size_t newsize, gfp_t flags)
 +extern void *kvrealloc_noprof(const void *p, size_t oldsize, size_t newsize, gfp_t flags)
  		      __realloc_size(3);
 +#define kvrealloc(...)				alloc_hooks(kvrealloc_noprof(__VA_ARGS__))
 +
  extern void kvfree(const void *addr);
  DEFINE_FREE(kvfree, void *, if (_T) kvfree(_T))
  

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 484 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-05-15 22:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-29  1:43 linux-next: manual merge of the net-next tree with the mm tree Stephen Rothwell
2024-04-29  2:33 ` Stephen Rothwell
2024-05-15 22:51 ` Stephen Rothwell
2024-05-15 22:55   ` Stephen Rothwell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox