From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752773AbdHBUHB (ORCPT ); Wed, 2 Aug 2017 16:07:01 -0400 Received: from mx2.suse.de ([195.135.220.15]:40005 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752389AbdHBUG6 (ORCPT ); Wed, 2 Aug 2017 16:06:58 -0400 Date: Wed, 2 Aug 2017 13:06:44 -0700 From: Davidlohr Bueso To: Guillaume Knispel Cc: Andrew Morton , Manfred Spraul , Kees Cook , Alexey Dobriyan , "Eric W. Biederman" , "Peter Zijlstra (Intel)" , Ingo Molnar , Sebastian Andrzej Siewior , Serge Hallyn , Andrey Vagin , Marc Pardo , linux-kernel@vger.kernel.org Subject: Re: [PATCH] ipc: optimize semget/shmget/msgget for lots of keys Message-ID: <20170802200644.GA2395@linux-80c1.suse> References: <20170731084237.GA123231@ubuntu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20170731084237.GA123231@ubuntu> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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); Thanks, Davidlohr