linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* linux-next: manual merge of the bitmap tree with Linus' tree
@ 2022-05-23  9:14 Stephen Rothwell
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Rothwell @ 2022-05-23  9:14 UTC (permalink / raw)
  To: Yury Norov
  Cc: Linux Kernel Mailing List, Linux Next Mailing List, Paolo Bonzini

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

Hi all,

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

  arch/x86/kvm/hyperv.c

between commit:

  ea8c66fe8d8f ("KVM: x86: hyper-v: fix type of valid_bank_mask")

from Linus' tree and commit:

  017a983d0ecf ("KVM: x86: hyper-v: replace bitmap_weight() with hweight64()")

from the bitmap tree.

I fixed it up (I just used the latter) 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

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

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

* linux-next: manual merge of the bitmap tree with Linus' tree
@ 2023-03-07  0:27 Stephen Rothwell
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Rothwell @ 2023-03-07  0:27 UTC (permalink / raw)
  To: Yury Norov
  Cc: Linus Torvalds, Linux Kernel Mailing List, Linux Next Mailing List

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

Hi all,

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

  include/linux/cpumask.h

between commit:

  596ff4a09b89 ("cpumask: re-introduce constant-sized cpumask optimizations")

from Linus' tree and commit:

  1507ca9f866c ("bitmap: switch from inline to __always_inline")

from the bitmap tree.

I fixed it up (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/cpumask.h
index ce8eb7ef2107,fcb35ea34090..000000000000
--- a/include/linux/cpumask.h
+++ b/include/linux/cpumask.h
@@@ -157,9 -124,9 +157,9 @@@ static __always_inline unsigned int cpu
   *
   * Returns >= nr_cpu_ids if no cpus set.
   */
- static inline unsigned int cpumask_first(const struct cpumask *srcp)
+ static __always_inline unsigned int cpumask_first(const struct cpumask *srcp)
  {
 -	return find_first_bit(cpumask_bits(srcp), nr_cpumask_bits);
 +	return find_first_bit(cpumask_bits(srcp), small_cpumask_bits);
  }
  
  /**
@@@ -168,9 -135,9 +168,9 @@@
   *
   * Returns >= nr_cpu_ids if all cpus are set.
   */
- static inline unsigned int cpumask_first_zero(const struct cpumask *srcp)
+ static __always_inline unsigned int cpumask_first_zero(const struct cpumask *srcp)
  {
 -	return find_first_zero_bit(cpumask_bits(srcp), nr_cpumask_bits);
 +	return find_first_zero_bit(cpumask_bits(srcp), small_cpumask_bits);
  }
  
  /**
@@@ -180,10 -147,10 +180,10 @@@
   *
   * Returns >= nr_cpu_ids if no cpus set in both.  See also cpumask_next_and().
   */
- static inline
+ static __always_inline
  unsigned int cpumask_first_and(const struct cpumask *srcp1, const struct cpumask *srcp2)
  {
 -	return find_first_and_bit(cpumask_bits(srcp1), cpumask_bits(srcp2), nr_cpumask_bits);
 +	return find_first_and_bit(cpumask_bits(srcp1), cpumask_bits(srcp2), small_cpumask_bits);
  }
  
  /**
@@@ -192,9 -159,9 +192,9 @@@
   *
   * Returns	>= nr_cpumask_bits if no CPUs set.
   */
- static inline unsigned int cpumask_last(const struct cpumask *srcp)
+ static __always_inline unsigned int cpumask_last(const struct cpumask *srcp)
  {
 -	return find_last_bit(cpumask_bits(srcp), nr_cpumask_bits);
 +	return find_last_bit(cpumask_bits(srcp), small_cpumask_bits);
  }
  
  /**
@@@ -279,10 -246,20 +279,10 @@@ unsigned int cpumask_next_and(int n, co
   * After the loop, cpu is >= nr_cpu_ids.
   */
  #define for_each_cpu(cpu, mask)				\
 -	for_each_set_bit(cpu, cpumask_bits(mask), nr_cpumask_bits)
 -
 -/**
 - * for_each_cpu_not - iterate over every cpu in a complemented mask
 - * @cpu: the (optionally unsigned) integer iterator
 - * @mask: the cpumask pointer
 - *
 - * After the loop, cpu is >= nr_cpu_ids.
 - */
 -#define for_each_cpu_not(cpu, mask)				\
 -	for_each_clear_bit(cpu, cpumask_bits(mask), nr_cpumask_bits)
 +	for_each_set_bit(cpu, cpumask_bits(mask), small_cpumask_bits)
  
  #if NR_CPUS == 1
- static inline
+ static __always_inline
  unsigned int cpumask_next_wrap(int n, const struct cpumask *mask, int start, bool wrap)
  {
  	cpumask_check(start);
@@@ -377,9 -354,9 +377,9 @@@ unsigned int cpumask_any_but(const stru
   *
   * Returns >= nr_cpu_ids if such cpu doesn't exist.
   */
- static inline unsigned int cpumask_nth(unsigned int cpu, const struct cpumask *srcp)
+ static __always_inline unsigned int cpumask_nth(unsigned int cpu, const struct cpumask *srcp)
  {
 -	return find_nth_bit(cpumask_bits(srcp), nr_cpumask_bits, cpumask_check(cpu));
 +	return find_nth_bit(cpumask_bits(srcp), small_cpumask_bits, cpumask_check(cpu));
  }
  
  /**
@@@ -518,23 -495,19 +518,23 @@@ static __always_inline bool cpumask_tes
  /**
   * cpumask_setall - set all cpus (< nr_cpu_ids) in a cpumask
   * @dstp: the cpumask pointer
 + *
 + * Note: since we set bits, we should use the tighter 'bitmap_set()' with
 + * the eact number of bits, not 'bitmap_fill()' that will fill past the
 + * end.
   */
- static inline void cpumask_setall(struct cpumask *dstp)
+ static __always_inline void cpumask_setall(struct cpumask *dstp)
  {
 -	bitmap_fill(cpumask_bits(dstp), nr_cpumask_bits);
 +	bitmap_set(cpumask_bits(dstp), 0, nr_cpumask_bits);
  }
  
  /**
   * cpumask_clear - clear all cpus (< nr_cpu_ids) in a cpumask
   * @dstp: the cpumask pointer
   */
- static inline void cpumask_clear(struct cpumask *dstp)
+ static __always_inline void cpumask_clear(struct cpumask *dstp)
  {
 -	bitmap_zero(cpumask_bits(dstp), nr_cpumask_bits);
 +	bitmap_zero(cpumask_bits(dstp), large_cpumask_bits);
  }
  
  /**
@@@ -652,9 -637,9 +652,9 @@@ static __always_inline bool cpumask_sub
   * cpumask_empty - *srcp == 0
   * @srcp: the cpumask to that all cpus < nr_cpu_ids are clear.
   */
- static inline bool cpumask_empty(const struct cpumask *srcp)
+ static __always_inline bool cpumask_empty(const struct cpumask *srcp)
  {
 -	return bitmap_empty(cpumask_bits(srcp), nr_cpumask_bits);
 +	return bitmap_empty(cpumask_bits(srcp), small_cpumask_bits);
  }
  
  /**
@@@ -670,9 -655,9 +670,9 @@@ static __always_inline bool cpumask_ful
   * cpumask_weight - Count of bits in *srcp
   * @srcp: the cpumask to count bits (< nr_cpu_ids) in.
   */
- static inline unsigned int cpumask_weight(const struct cpumask *srcp)
+ static __always_inline unsigned int cpumask_weight(const struct cpumask *srcp)
  {
 -	return bitmap_weight(cpumask_bits(srcp), nr_cpumask_bits);
 +	return bitmap_weight(cpumask_bits(srcp), small_cpumask_bits);
  }
  
  /**
@@@ -680,10 -665,10 +680,10 @@@
   * @srcp1: the cpumask to count bits (< nr_cpu_ids) in.
   * @srcp2: the cpumask to count bits (< nr_cpu_ids) in.
   */
- static inline unsigned int cpumask_weight_and(const struct cpumask *srcp1,
+ static __always_inline unsigned int cpumask_weight_and(const struct cpumask *srcp1,
  						const struct cpumask *srcp2)
  {
 -	return bitmap_weight_and(cpumask_bits(srcp1), cpumask_bits(srcp2), nr_cpumask_bits);
 +	return bitmap_weight_and(cpumask_bits(srcp1), cpumask_bits(srcp2), small_cpumask_bits);
  }
  
  /**
@@@ -717,10 -702,10 +717,10 @@@ static __always_inline void cpumask_shi
   * @dstp: the result
   * @srcp: the input cpumask
   */
- static inline void cpumask_copy(struct cpumask *dstp,
+ static __always_inline void cpumask_copy(struct cpumask *dstp,
  				const struct cpumask *srcp)
  {
 -	bitmap_copy(cpumask_bits(dstp), cpumask_bits(srcp), nr_cpumask_bits);
 +	bitmap_copy(cpumask_bits(dstp), cpumask_bits(srcp), large_cpumask_bits);
  }
  
  /**
@@@ -802,9 -787,9 +802,9 @@@ static __always_inline int cpulist_pars
  /**
   * cpumask_size - size to allocate for a 'struct cpumask' in bytes
   */
- static inline unsigned int cpumask_size(void)
+ static __always_inline unsigned int cpumask_size(void)
  {
 -	return BITS_TO_LONGS(nr_cpumask_bits) * sizeof(long);
 +	return BITS_TO_LONGS(large_cpumask_bits) * sizeof(long);
  }
  
  /*

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

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

end of thread, other threads:[~2023-03-07  0:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-23  9:14 linux-next: manual merge of the bitmap tree with Linus' tree Stephen Rothwell
2023-03-07  0:27 Stephen Rothwell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).