public inbox for linux-next@vger.kernel.org 
 help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb•auug.org.au>
To: Andrew Morton <akpm@linux-foundation•org>,
	Yury Norov <yury.norov@gmail•com>
Cc: Linux Kernel Mailing List <linux-kernel@vger•kernel.org>,
	Linux Next Mailing List <linux-next@vger•kernel.org>,
	Sander Vanheule <sander@svanheule•net>
Subject: Re: linux-next: manual merge of the mm tree with the bitmap tree
Date: Mon, 4 Jul 2022 17:26:09 +1000	[thread overview]
Message-ID: <20220704172609.27ec5d8c@canb.auug.org.au> (raw)
In-Reply-To: <20220704165841.1637cfff@canb.auug.org.au>

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

Hi all,

On Mon, 4 Jul 2022 16:58:41 +1000 Stephen Rothwell <sfr@canb•auug.org.au> wrote:
>
> Today's linux-next merge of the mm tree got a conflict in:
> 
>   include/linux/cpumask.h
> 
> between commits:
> 
>   50e413c31800 ("lib/cpumask: change return types to unsigned")
>   e32bd0390739 ("lib/cpumask: move one-line wrappers around find_bit to the header")
> 
> from the bitmap tree and commits:
> 
>   2b0b9f2665b2 ("cpumask: Fix invalid uniprocessor mask assumption")
>   284d22458843 ("cpumask: update cpumask_next_wrap() signature")
> 
> from the mm tree.
> 
> I fixed it up (I hope, 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

It actually needed to be:

785d45d2ce79973aa13920e855aff8a67c61b1c8
diff --cc include/linux/cpumask.h
index 0738a6c9be40,523857884ae4..6a8f75cc9985
--- a/include/linux/cpumask.h
+++ b/include/linux/cpumask.h
@@@ -274,29 -179,31 +195,47 @@@ static inline unsigned int cpumask_next
  	return find_next_zero_bit(cpumask_bits(srcp), nr_cpumask_bits, n+1);
  }
  
 -int __pure cpumask_next_and(int n, const struct cpumask *, const struct cpumask *);
 -int __pure cpumask_any_but(const struct cpumask *mask, unsigned int cpu);
 +/**
 + * cpumask_next_and - get the next cpu in *src1p & *src2p
 + * @n: the cpu prior to the place to search (ie. return will be > @n)
 + * @src1p: the first cpumask pointer
 + * @src2p: the second cpumask pointer
 + *
 + * Returns >= nr_cpu_ids if no further cpus set in both.
 + */
 +static inline
 +unsigned int cpumask_next_and(int n, const struct cpumask *src1p,
 +		     const struct cpumask *src2p)
 +{
 +	/* -1 is a legal arg here. */
 +	if (n != -1)
 +		cpumask_check(n);
 +	return find_next_and_bit(cpumask_bits(src1p), cpumask_bits(src2p),
 +		nr_cpumask_bits, n + 1);
 +}
  
+ #if NR_CPUS == 1
+ /* Uniprocessor: there is only one valid CPU */
+ static inline unsigned int cpumask_local_spread(unsigned int i, int node)
+ {
+ 	return 0;
+ }
+ 
+ static inline int cpumask_any_and_distribute(const struct cpumask *src1p,
+ 					     const struct cpumask *src2p) {
+ 	return cpumask_first_and(src1p, src2p);
+ }
+ 
+ static inline int cpumask_any_distribute(const struct cpumask *srcp)
+ {
+ 	return cpumask_first(srcp);
+ }
+ #else
  unsigned int cpumask_local_spread(unsigned int i, int node);
 -int cpumask_any_and_distribute(const struct cpumask *src1p,
 +unsigned int cpumask_any_and_distribute(const struct cpumask *src1p,
  			       const struct cpumask *src2p);
 -int cpumask_any_distribute(const struct cpumask *srcp);
 +unsigned int cpumask_any_distribute(const struct cpumask *srcp);
+ #endif /* NR_CPUS */
  
  /**
   * for_each_cpu - iterate over every cpu in a mask
@@@ -322,7 -229,7 +261,7 @@@
  		(cpu) = cpumask_next_zero((cpu), (mask)),	\
  		(cpu) < nr_cpu_ids;)
  
- unsigned int cpumask_next_wrap(int n, const struct cpumask *mask, int start, bool wrap);
 -int __pure cpumask_next_wrap(int n, const struct cpumask *mask, int start, bool wrap);
++unsigned int __pure cpumask_next_wrap(int n, const struct cpumask *mask, int start, bool wrap);
  
  /**
   * for_each_cpu_wrap - iterate over every cpu in a mask, starting at a specified location
@@@ -358,27 -265,6 +297,26 @@@
  		(cpu) = cpumask_next_and((cpu), (mask1), (mask2)),	\
  		(cpu) < nr_cpu_ids;)
  
 +/**
 + * cpumask_any_but - return a "random" in a cpumask, but not this one.
 + * @mask: the cpumask to search
 + * @cpu: the cpu to ignore.
 + *
 + * Often used to find any cpu but smp_processor_id() in a mask.
 + * Returns >= nr_cpu_ids if no cpus set.
 + */
 +static inline
 +unsigned int cpumask_any_but(const struct cpumask *mask, unsigned int cpu)
 +{
 +	unsigned int i;
 +
 +	cpumask_check(cpu);
 +	for_each_cpu(i, mask)
 +		if (i != cpu)
 +			break;
 +	return i;
 +}
- #endif /* SMP */
 +
  #define CPU_BITS_NONE						\
  {								\
  	[0 ... BITS_TO_LONGS(NR_CPUS)-1] = 0UL			\

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

  reply	other threads:[~2022-07-04  7:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-04  6:58 linux-next: manual merge of the mm tree with the bitmap tree Stephen Rothwell
2022-07-04  7:26 ` Stephen Rothwell [this message]
2022-07-10  7:07   ` Sander Vanheule
  -- strict thread matches above, loose matches on Subject: below --
2022-07-04  7:13 Stephen Rothwell
2022-07-15 11:14 Stephen Rothwell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220704172609.27ec5d8c@canb.auug.org.au \
    --to=sfr@canb$(echo .)auug.org.au \
    --cc=akpm@linux-foundation$(echo .)org \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=linux-next@vger$(echo .)kernel.org \
    --cc=sander@svanheule$(echo .)net \
    --cc=yury.norov@gmail$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox