From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hugh Dickins Subject: Re: [PATCH 4/5] shmem: use call_once() Date: Tue, 11 Mar 2008 13:41:54 +0000 (GMT) Message-ID: References: <20080310145704.GA6396@APFDCB5C> <20080310150026.GA6407@APFDCB5C> <20080310150148.GB6407@APFDCB5C> <20080310150308.GC6407@APFDCB5C> <961aa3350803110529o61fe42e8q27ab10e0cb8f9bb6@mail.gmail.com> Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: linux-kernel@vger.kernel.org, akpm@linux-foundation.org, linux-fsdevel@vger.kernel.org, William Irwin , Matt Mackall To: Akinobu Mita Return-path: Received: from extu-mxob-1.symantec.com ([216.10.194.28]:42091 "EHLO extu-mxob-1.symantec.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750859AbYCKU4M (ORCPT ); Tue, 11 Mar 2008 16:56:12 -0400 In-Reply-To: <961aa3350803110529o61fe42e8q27ab10e0cb8f9bb6@mail.gmail.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Tue, 11 Mar 2008, Akinobu Mita wrote: > 2008/3/11, Hugh Dickins : > > On Tue, 11 Mar 2008, Akinobu Mita wrote: > > > This patch defers mounting tmpfs till shmem_file_setup() is > > > called first time by using call_once(). > > > > Please explain why we might need this patch: is something changing > > elsewhere? Or are you misled by that "module_init(init_tmpfs)" > > into thinking that mm/shmem.c is sometimes built modular? > > If no processes call shmem_file_setup() (via shm_get(2)), it is unnecessary or shmem_zero_setup, not very common > to do vfs_kern_mount(&tmpfs_fs_type, ...) unconditionary in boot-time. > So I thought it is suitable example to demonstrate how to use "call_once()" > in this patch set. Oh, I see, thanks. Well, I don't feel all that strongly about it; but on the whole I'd prefer we leave it as part of the __init, than change it around to provide this example (and risk introducing some weird issue e.g. related to its "dev"?). I guess the same should go for the huge and the tiny, whereas you have better justification in the idr case. Call me over-cautious. Hugh