Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751987AbdHGSVX (ORCPT ); Mon, 7 Aug 2017 14:21:23 -0400 Received: from mx2.suse.de ([195.135.220.15]:36566 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751875AbdHGSVU (ORCPT ); Mon, 7 Aug 2017 14:21:20 -0400 Date: Mon, 7 Aug 2017 11:21:03 -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: <20170807182103.GC25038@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 Content-Length: 836 Lines: 28 On Mon, 31 Jul 2017, Guillaume Knispel wrote: > struct ipc_ids { > int in_use; > unsigned short seq; >+ bool tables_initialized; So this is really ugly to have, but I understand why you added it. I wonder what folks would think if we just panic() in the rhashtable_init() ENOMEM case, and convert the EINVALs to WARNs. This way the function would always be called successfully. This is similar to what futex_init does, with the underlying hash table allocator panicing. sems and msg would probably have to be converted to pure_initcall, but hey, we could at least get the symmetry back. > static int __init ipc_ns_init(void) > { >- shm_init_ns(&init_ipc_ns); >- return 0; >+ const int err = shm_init_ns(&init_ipc_ns); >+ WARN(err, "ipc: sysV shm_init_ns failed: %d\n", err); nit: s/sysV/sysv >+ return err; > } Thanks, Davidlohr