From: Guillaume Knispel <guillaume.knispel@supersonicimagine.com>
To: Davidlohr Bueso <dave@stgolabs.net>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Manfred Spraul <manfred@colorfullife.com>,
Kees Cook <keescook@chromium.org>,
Alexey Dobriyan <adobriyan@gmail.com>,
"Eric W. Biederman" <ebiederm@xmission.com>,
"Peter Zijlstra (Intel)" <peterz@infradead.org>,
Ingo Molnar <mingo@kernel.org>,
Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
Serge Hallyn <serge@hallyn.com>, Andrey Vagin <avagin@openvz.org>,
Marc Pardo <marc.pardo@supersonicimagine.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ipc: optimize semget/shmget/msgget for lots of keys
Date: Thu, 3 Aug 2017 19:14:29 +0200 [thread overview]
Message-ID: <20170803171429.GA2237@ubuntu> (raw)
In-Reply-To: <20170802200644.GA2395@linux-80c1.suse>
On Wed, Aug 02, 2017 at 01:06:44PM -0700, Davidlohr Bueso wrote:
> On Mon, 31 Jul 2017, Guillaume Knispel wrote:
> >static int __init ipc_init(void)
> >{
> >- sem_init();
> >- msg_init();
> >+ int err_sem, err_msg;
> >+
> >+ err_sem = sem_init();
> >+ WARN(err_sem, "ipc: sysV sem_init failed: %d\n", err_sem);
> >+ err_msg = msg_init();
> >+ WARN(err_msg, "ipc: sysV msg_init failed: %d\n", err_msg);
> > shm_init();
>
> This shows the ugliness of the underlying ipc init asymmetry. Specifically,
> 140d0b2108f (Do 'shm_init_ns()' in an early pure_initcall) was the final
> nail in the coffin to fix an exit_shm() race.
>
> While normally we could just initialize the ipc_ids fields statically and
> be over with initcall dependencies, your patch will require inits be done
> dynamically for the rhashtable_init(). Oh well.
>
> Also, why do you do this?
>
> >-pure_initcall(ipc_ns_init);
> >+core_initcall(ipc_ns_init);
In linux/init.h I saw that a pure_initcall is reserved to only
initialize variables and must have no dependency on anything else;
I interpreted that, + "pure" in the name, thinking we should not e.g.
allocate in a pure_initcall, however I see that net_ns_init() calls
kmem_cache_create() and others, so maybe we can keep ipc_ns_init() as
a pure_initcall?
Guillaume
next prev parent reply other threads:[~2017-08-03 17:14 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-31 8:42 [PATCH] ipc: optimize semget/shmget/msgget for lots of keys Guillaume Knispel
2017-07-31 15:45 ` Davidlohr Bueso
2017-08-01 1:17 ` Guillaume Knispel
2017-08-01 15:51 ` Davidlohr Bueso
2017-08-02 20:06 ` Davidlohr Bueso
2017-08-03 17:14 ` Guillaume Knispel [this message]
2017-08-07 17:33 ` Davidlohr Bueso
2017-08-07 18:21 ` Davidlohr Bueso
2017-08-09 16:15 ` Guillaume Knispel
2017-08-14 6:05 ` [lkp-robot] [ipc] cb6268f05d: reaim.jobs_per_min 865% improvement kernel test robot
2017-08-14 17:59 ` Kees Cook
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=20170803171429.GA2237@ubuntu \
--to=guillaume.knispel@supersonicimagine.com \
--cc=adobriyan@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=avagin@openvz.org \
--cc=bigeasy@linutronix.de \
--cc=dave@stgolabs.net \
--cc=ebiederm@xmission.com \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=manfred@colorfullife.com \
--cc=marc.pardo@supersonicimagine.com \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=serge@hallyn.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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