From: Stephen Rothwell <sfr@canb•auug.org.au>
To: "Paul E. McKenney" <paulmck@linux•vnet.ibm.com>
Cc: linux-next@vger•kernel.org, linux-kernel@vger•kernel.org,
Tejun Heo <tj@kernel•org>,
Andrew Morton <akpm@linux-foundation•org>
Subject: linux-next: manual merge of the rcu tree with Linus' tree
Date: Wed, 8 Mar 2017 11:46:33 +1100 [thread overview]
Message-ID: <20170308114633.42cc839c@canb.auug.org.au> (raw)
Hi Paul,
Today's linux-next merge of the rcu tree got a conflict in:
mm/slab_common.c
between commit:
657dc2f97220 ("slab: remove synchronous rcu_barrier() call in memcg cache release path")
from Linus' tree and commit:
24b7cb25b8d1 ("mm: Rename SLAB_DESTROY_BY_RCU to SLAB_TYPESAFE_BY_RCU")
from the rcu 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 mm/slab_common.c
index 09d0e849b07f,296413c2bbcd..000000000000
--- a/mm/slab_common.c
+++ b/mm/slab_common.c
@@@ -494,55 -458,29 +494,56 @@@ out_unlock
}
EXPORT_SYMBOL(kmem_cache_create);
-static int shutdown_cache(struct kmem_cache *s,
- struct list_head *release, bool *need_rcu_barrier)
+static void slab_caches_to_rcu_destroy_workfn(struct work_struct *work)
{
- if (__kmem_cache_shutdown(s) != 0)
- return -EBUSY;
+ LIST_HEAD(to_destroy);
+ struct kmem_cache *s, *s2;
+
+ /*
- * On destruction, SLAB_DESTROY_BY_RCU kmem_caches are put on the
++ * On destruction, SLAB_TYPESAFE_BY_RCU kmem_caches are put on the
+ * @slab_caches_to_rcu_destroy list. The slab pages are freed
+ * through RCU and and the associated kmem_cache are dereferenced
+ * while freeing the pages, so the kmem_caches should be freed only
+ * after the pending RCU operations are finished. As rcu_barrier()
+ * is a pretty slow operation, we batch all pending destructions
+ * asynchronously.
+ */
+ mutex_lock(&slab_mutex);
+ list_splice_init(&slab_caches_to_rcu_destroy, &to_destroy);
+ mutex_unlock(&slab_mutex);
+
+ if (list_empty(&to_destroy))
+ return;
- rcu_barrier();
+ if (s->flags & SLAB_TYPESAFE_BY_RCU)
+ *need_rcu_barrier = true;
- list_move(&s->list, release);
- return 0;
+ list_for_each_entry_safe(s, s2, &to_destroy, list) {
+#ifdef SLAB_SUPPORTS_SYSFS
+ sysfs_slab_release(s);
+#else
+ slab_kmem_cache_release(s);
+#endif
+ }
}
-static void release_caches(struct list_head *release, bool need_rcu_barrier)
+static int shutdown_cache(struct kmem_cache *s)
{
- struct kmem_cache *s, *s2;
+ /* free asan quarantined objects */
+ kasan_cache_shutdown(s);
- if (need_rcu_barrier)
- rcu_barrier();
+ if (__kmem_cache_shutdown(s) != 0)
+ return -EBUSY;
- list_for_each_entry_safe(s, s2, release, list) {
+ memcg_unlink_cache(s);
+ list_del(&s->list);
+
- if (s->flags & SLAB_DESTROY_BY_RCU) {
++ if (s->flags & SLAB_TYPESAFE_BY_RCU) {
+ list_add_tail(&s->list, &slab_caches_to_rcu_destroy);
+ schedule_work(&slab_caches_to_rcu_destroy_work);
+ } else {
#ifdef SLAB_SUPPORTS_SYSFS
- sysfs_slab_remove(s);
+ sysfs_slab_release(s);
#else
slab_kmem_cache_release(s);
#endif
next reply other threads:[~2017-03-08 0:56 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-08 0:46 Stephen Rothwell [this message]
2017-03-08 0:56 ` linux-next: manual merge of the rcu tree with Linus' tree Stephen Rothwell
-- strict thread matches above, loose matches on Subject: below --
2022-10-17 22:41 Stephen Rothwell
2022-10-18 18:38 ` Paul E. McKenney
2022-07-08 4:12 Stephen Rothwell
2022-07-08 15:23 ` Paul E. McKenney
2018-06-12 0:46 Stephen Rothwell
2018-06-12 1:01 ` Paul E. McKenney
2018-06-18 3:48 ` Stephen Rothwell
2018-06-18 3:49 ` Stephen Rothwell
2018-06-18 14:48 ` Paul E. McKenney
2018-05-14 3:46 Stephen Rothwell
2018-05-15 17:44 ` Paul E. McKenney
2017-09-26 3:00 Stephen Rothwell
2017-09-26 3:26 ` Paul E. McKenney
2017-09-26 3:42 ` Stephen Rothwell
2016-03-30 0:32 Stephen Rothwell
2016-03-30 10:30 ` Paul E. McKenney
2016-03-30 0:23 Stephen Rothwell
2012-11-29 3:06 Stephen Rothwell
2012-11-29 22:12 ` Paul E. McKenney
2012-08-06 2:31 Stephen Rothwell
2011-09-27 6:04 Stephen Rothwell
2011-09-27 12:20 ` Frederic Weisbecker
2011-09-27 5:14 Stephen Rothwell
2011-09-27 13:14 ` Borislav Petkov
2010-10-06 2:38 Stephen Rothwell
2010-10-06 4:17 ` Paul E. McKenney
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=20170308114633.42cc839c@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=paulmck@linux$(echo .)vnet.ibm.com \
--cc=tj@kernel$(echo .)org \
/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