lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20211007172713.2b8ffca0@canb.auug.org.au>
Date:   Thu, 7 Oct 2021 17:27:13 +1100
From:   Stephen Rothwell <sfr@...b.auug.org.au>
To:     Andrew Morton <akpm@...ux-foundation.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>,
        "H. Peter Anvin" <hpa@...or.com>,
        Peter Zijlstra <peterz@...radead.org>
Cc:     Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Linux Next Mailing List <linux-next@...r.kernel.org>,
        Nicholas Piggin <npiggin@...il.com>
Subject: linux-next: manual merge of the akpm-current tree with the tip tree

Hi all,

Today's linux-next merge of the akpm-current tree got conflicts in:

  include/linux/sched/mm.h
  kernel/sched/core.c

between commit:

  8d491de6edc2 ("sched: Move mmdrop to RCU on RT")

from the tip tree and commits:

  5a21ba83ddb2 ("lazy tlb: introduce lazy mm refcount helper functions")
  ade2ef2cb563 ("lazy tlb: allow lazy tlb mm refcounting to be configurable")

from the akpm-current tree.

I don't know if my merging of both these makes sense, but guidance
is welcome.

I fixed it up (see below, and used the latter version of kernel/sched/core.c
) 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/sched/mm.h
index aca874d33fe6,fd6e4d14f477..000000000000
--- a/include/linux/sched/mm.h
+++ b/include/linux/sched/mm.h
@@@ -49,35 -49,27 +49,56 @@@ static inline void mmdrop(struct mm_str
  		__mmdrop(mm);
  }
  
 +#ifdef CONFIG_PREEMPT_RT
 +/*
 + * RCU callback for delayed mm drop. Not strictly RCU, but call_rcu() is
 + * by far the least expensive way to do that.
 + */
 +static inline void __mmdrop_delayed(struct rcu_head *rhp)
 +{
 +	struct mm_struct *mm = container_of(rhp, struct mm_struct, delayed_drop);
 +
 +	__mmdrop(mm);
 +}
 +
 +/*
 + * Invoked from finish_task_switch(). Delegates the heavy lifting on RT
 + * kernels via RCU.
 + */
 +static inline void mmdrop_sched(struct mm_struct *mm)
 +{
 +	/* Provides a full memory barrier. See mmdrop() */
 +	if (atomic_dec_and_test(&mm->mm_count))
 +		call_rcu(&mm->delayed_drop, __mmdrop_delayed);
 +}
 +#else
 +static inline void mmdrop_sched(struct mm_struct *mm)
 +{
 +	mmdrop(mm);
 +}
 +#endif
 +
+ /* Helpers for lazy TLB mm refcounting */
+ static inline void mmgrab_lazy_tlb(struct mm_struct *mm)
+ {
+ 	if (IS_ENABLED(CONFIG_MMU_LAZY_TLB_REFCOUNT))
+ 		mmgrab(mm);
+ }
+ 
+ static inline void mmdrop_lazy_tlb(struct mm_struct *mm)
+ {
+ 	if (IS_ENABLED(CONFIG_MMU_LAZY_TLB_REFCOUNT)) {
 -		mmdrop(mm);
++		mmdrop_sched(mm);
+ 	} else {
+ 		/*
+ 		 * mmdrop_lazy_tlb must provide a full memory barrier, see the
+ 		 * membarrier comment in finish_task_switch which relies on
+ 		 * this.
+ 		 */
+ 		smp_mb();
+ 	}
+ }
+ 
  /**
   * mmget() - Pin the address space associated with a &struct mm_struct.
   * @mm: The address space to pin.

Content of type "application/pgp-signature" skipped

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ