From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756059Ab2FWVM2 (ORCPT ); Sat, 23 Jun 2012 17:12:28 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:36427 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755725Ab2FWVLn (ORCPT ); Sat, 23 Jun 2012 17:11:43 -0400 Date: Sat, 23 Jun 2012 22:11:39 +0100 From: Al Viro To: Oleg Nesterov Cc: Mimi Zohar , Linus Torvalds , ". James Morris" , linux-security-module@vger.kernel.org, linux-kernel Subject: Re: deferring __fput() Message-ID: <20120623211139.GL14083@ZenIV.linux.org.uk> References: <1340369098.2464.20.camel@falcor> <20120623092049.GH14083@ZenIV.linux.org.uk> <20120623194505.GI14083@ZenIV.linux.org.uk> <20120623203800.GA10306@redhat.com> <20120623210141.GK14083@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120623210141.GK14083@ZenIV.linux.org.uk> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jun 23, 2012 at 10:01:41PM +0100, Al Viro wrote: > On Sat, Jun 23, 2012 at 10:38:00PM +0200, Oleg Nesterov wrote: > > > > Matter of fact, it would become identical to struct rcu_head > > > after that... > > > > This is not clear to me... Why this is good? > > Occam's Razor. > > > I understand that sizeof(task_work) == sizeof(rcu_head) would be > > nice, probably you meant just this? > > More than that - the callback type is also the same (pointer to such > struct -> void). IOW, they both look like two instances of the > same thing ("list of callbacks"), differing only in what and > when does calling. BTW, scratch that "task_work + cred" - cred has rcu_head in it. So we can put a union in there and slap the trimmed task_work into it. Voila - there goes separate allocation and *any* need for ->data. It's just container_of(), in that case as well.