From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933365Ab1IBKFX (ORCPT ); Fri, 2 Sep 2011 06:05:23 -0400 Received: from mail-ww0-f44.google.com ([74.125.82.44]:56054 "EHLO mail-ww0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933028Ab1IBKFV (ORCPT ); Fri, 2 Sep 2011 06:05:21 -0400 Subject: Re: [PATCH 1/4] posix-timers: move global timer id management to signal_struct v2 From: Eric Dumazet To: Thomas Gleixner Cc: Andi Kleen , linux-kernel@vger.kernel.org, akpm@linux-foundation.org, Andi Kleen In-Reply-To: References: <1314661157-22173-1-git-send-email-andi@firstfloor.org> Content-Type: text/plain; charset="UTF-8" Date: Fri, 02 Sep 2011 12:05:23 +0200 Message-ID: <1314957923.2573.11.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC> Mime-Version: 1.0 X-Mailer: Evolution 2.32.2 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le vendredi 02 septembre 2011 à 11:19 +0200, Thomas Gleixner a écrit : > On Mon, 29 Aug 2011, Andi Kleen wrote: > > Hint: Ccing maintainers of affected code might help to get code > reviewed and eventually merged. > > > #include > > > > #ifdef CONFIG_SMP > > @@ -37,6 +38,7 @@ extern struct fs_struct init_fs; > > .list = LIST_HEAD_INIT(sig.shared_pending.list), \ > > .signal = {{0}}}, \ > > .posix_timers = LIST_HEAD_INIT(sig.posix_timers), \ > > + .idr_lock = __SPIN_LOCK_UNLOCKED(idr_lock), \ > > sig.idr_lock > > Also is there a requirement, that this is a spinlock? AFAICT it's all > process context and slowpath, so we can make it a mutex. If so, please Andi remove the idr_pre_get() call : This would be useless, since we are allowed to sleep under mutex. This would lower the memory needs of a per-process idr pre-initted with IDR_FREE_MAX items in free list. This was OK for a system wide posix_timers_id.