Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755900Ab1BNP5e (ORCPT ); Mon, 14 Feb 2011 10:57:34 -0500 Received: from casper.infradead.org ([85.118.1.10]:40504 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755796Ab1BNP5c convert rfc822-to-8bit (ORCPT ); Mon, 14 Feb 2011 10:57:32 -0500 Subject: Re: [PATCH 0/2] jump label: 2.6.38 updates From: Peter Zijlstra To: Jason Baron Cc: Mathieu Desnoyers , hpa@zytor.com, rostedt@goodmis.org, mingo@elte.hu, tglx@linutronix.de, andi@firstfloor.org, roland@redhat.com, rth@redhat.com, masami.hiramatsu.pt@hitachi.com, fweisbec@gmail.com, avi@redhat.com, davem@davemloft.net, sam@ravnborg.org, ddaney@caviumnetworks.com, michael@ellerman.id.au, linux-kernel@vger.kernel.org In-Reply-To: <20110214155113.GA2840@redhat.com> References: <1297452328.5226.89.camel@laptop> <1297460297.5226.99.camel@laptop> <1297536465.5226.108.camel@laptop> <20110214155113.GA2840@redhat.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Date: Mon, 14 Feb 2011 16:57:04 +0100 Message-ID: <1297699024.2401.12.camel@twins> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2919 Lines: 60 On Mon, 2011-02-14 at 10:51 -0500, Jason Baron wrote: > On Sat, Feb 12, 2011 at 07:47:45PM +0100, Peter Zijlstra wrote: > > On Fri, 2011-02-11 at 22:38 +0100, Peter Zijlstra wrote: > > > > > > So why can't we make that jump_label_entry::refcount and > > > jump_label_key::state an atomic_t and be done with it? > > > > So I had a bit of a poke at this because I didn't quite understand why > > all that stuff was as it was. I applied both Jason's patches and then > > basically rewrote kernel/jump_label.c just for kicks ;-) > > > > I haven't tried compiling this, let alone running it, but provided I > > didn't actually forget anything the storage per key is now 16 bytes when > > modules are disabled and 24 * (1 + mods) bytes for when they are > > enabled. The old code had 64 + 40 * mods bytes. > > > > I still need to clean up the static_branch_else bits and look at !x86 > > aside from the already mentioned bits.. but what do people think? > > > > --- > > Generally, I really like this! Its the direction I think the jump label > code should be going. The complete removal of the hash table, makes the > design a lot better and simpler. We just need to get some of the details > cleaned up, and of course we need this to compile :) But I don't see any > fundamental problems with this approach. > > Things that still need to be sorted out: > > 1) Since jump_label.h, are included in kernel.h, (indirectly via the > dynamic_debug.h) the atomic_t definitions could be problematic, since > atomic.h includes kernel.h indirectly...so we might need some header > magic. Yes, I remember running into that when I did the jump_label_ref stuff, some head-scratching is in order there. > 2) I had some code to disallow writing to module __init section, by > setting the 'key' value to 0, after the module->init was run, but > before, the memory was freed. And then I check for a non-zero key value > when the jump label is updated. In this way we can't corrupt some random > piece of memory. I had this done via the 'MODULE_STATE_LIVE' notifier. AH! I wondered what that was about.. that wouldn't work now since we actually rely on iter->key to remain what it was. > 3) For 'jump_label_enable()' 'jump_label_disable()' in the tracepoint > code, I'm not sure that there is an enable for each disable. So i'm not > sure if a refcount would work there. But we can fix this by first > checking 'jump_label_enabled()' before calling 'jump_label_eanble()' or > jump_label_ref(). This is safe b/c the the tracepoint code is protected > using the tracepoint_mutex. Right,.. I hadn't considered people using it like that, but like you said, that should be easily fixed. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/