From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4D766D16250 for ; Mon, 14 Oct 2024 12:14:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BA9216B0085; Mon, 14 Oct 2024 08:14:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B59496B0088; Mon, 14 Oct 2024 08:14:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9D24D6B0089; Mon, 14 Oct 2024 08:14:32 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 8000C6B0085 for ; Mon, 14 Oct 2024 08:14:32 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 874AD1A0DAB for ; Mon, 14 Oct 2024 12:14:18 +0000 (UTC) X-FDA: 82672100616.23.F8E0C78 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) by imf17.hostedemail.com (Postfix) with ESMTP id DF07840016 for ; Mon, 14 Oct 2024 12:14:24 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=MSkRzHJL; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=9eOjRoJL; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=MSkRzHJL; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=9eOjRoJL; spf=pass (imf17.hostedemail.com: domain of jack@suse.cz designates 195.135.223.130 as permitted sender) smtp.mailfrom=jack@suse.cz; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1728907928; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=WDvMMHa5hCU5rljm//6SmMBj9GhVvVjaeKHjUwQCpNw=; b=jYg0g3RW+MIepXg89bp8hqZh14zM/T242LjfslB5EieNvRsxCd4N/Xlno6DicDohesOoOF bBFDf6R96AAa26kzbRyIrx8eg2J8/XcdueGrk99s0BEp0ip3KacVJBfY3hSUOhyxenVLcw 50nGycJz3dOaszsyr5udjhdAmXGUIoQ= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1728907928; a=rsa-sha256; cv=none; b=CcNSiXzDMhjG8kQctVwZUG6bGxA5R5Kyhfutc6U6DZvmYp/hlaykPeTMTMFVxTYPueg88x flc7JI12krKqhCuYAxxq+ZpuI4UzWLYgJOiDSgMdenOx1n7JxWBfh7fAK+W78ApQgno0/3 a5aHcl1ie6G2b0Zf7MBHNxgs94U2seQ= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=MSkRzHJL; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=9eOjRoJL; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=MSkRzHJL; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=9eOjRoJL; spf=pass (imf17.hostedemail.com: domain of jack@suse.cz designates 195.135.223.130 as permitted sender) smtp.mailfrom=jack@suse.cz; dmarc=none Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 0923921B5C; Mon, 14 Oct 2024 12:14:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1728908068; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=WDvMMHa5hCU5rljm//6SmMBj9GhVvVjaeKHjUwQCpNw=; b=MSkRzHJL2U9tNILZ53M7T+G7hBt5Gu3qsdJDFOEQGfiSTxYSNoTxDzdn7XosPoeklNOD8O eZz7rgPHanpLc0QREwoMWLe0gXVWK5oHqMM6l65GTF2/zp2vqDfbQCN1/mMyFxh1iMJjFy xuTVOaZ/H7tyyf9Nlxs5WeIboGM/qAg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1728908068; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=WDvMMHa5hCU5rljm//6SmMBj9GhVvVjaeKHjUwQCpNw=; b=9eOjRoJLlTvz5l4PYWguZW27Xg22LNgu4zu/8XkcB0ssuDH50N40nmDYnhSbcx8qRjKZcM DmVFF+M12aAo5wAg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1728908068; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=WDvMMHa5hCU5rljm//6SmMBj9GhVvVjaeKHjUwQCpNw=; b=MSkRzHJL2U9tNILZ53M7T+G7hBt5Gu3qsdJDFOEQGfiSTxYSNoTxDzdn7XosPoeklNOD8O eZz7rgPHanpLc0QREwoMWLe0gXVWK5oHqMM6l65GTF2/zp2vqDfbQCN1/mMyFxh1iMJjFy xuTVOaZ/H7tyyf9Nlxs5WeIboGM/qAg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1728908068; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=WDvMMHa5hCU5rljm//6SmMBj9GhVvVjaeKHjUwQCpNw=; b=9eOjRoJLlTvz5l4PYWguZW27Xg22LNgu4zu/8XkcB0ssuDH50N40nmDYnhSbcx8qRjKZcM DmVFF+M12aAo5wAg== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id E756413A51; Mon, 14 Oct 2024 12:14:27 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id Kr5yOCMLDWe1PQAAD6G6ig (envelope-from ); Mon, 14 Oct 2024 12:14:27 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id 8A807A0896; Mon, 14 Oct 2024 14:14:27 +0200 (CEST) Date: Mon, 14 Oct 2024 14:14:27 +0200 From: Jan Kara To: Kaixiong Yu Cc: akpm@linux-foundation.org, mcgrof@kernel.org, ysato@users.sourceforge.jp, dalias@libc.org, glaubitz@physik.fu-berlin.de, luto@kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, hpa@zytor.com, viro@zeniv.linux.org.uk, brauner@kernel.org, jack@suse.cz, kees@kernel.org, j.granados@samsung.com, willy@infradead.org, Liam.Howlett@oracle.com, vbabka@suse.cz, lorenzo.stoakes@oracle.com, trondmy@kernel.org, anna@kernel.org, chuck.lever@oracle.com, jlayton@kernel.org, neilb@suse.de, okorniev@redhat.com, Dai.Ngo@oracle.com, tom@talpey.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, paul@paul-moore.com, jmorris@namei.org, linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, netdev@vger.kernel.org, linux-security-module@vger.kernel.org, dhowells@redhat.com, haifeng.xu@shopee.com, baolin.wang@linux.alibaba.com, shikemeng@huaweicloud.com, dchinner@redhat.com, bfoster@redhat.com, souravpanda@google.com, hannes@cmpxchg.org, rientjes@google.com, pasha.tatashin@soleen.com, david@redhat.com, ryan.roberts@arm.com, ying.huang@intel.com, yang@os.amperecomputing.com, zev@bewilderbeest.net, serge@hallyn.com, vegard.nossum@oracle.com, wangkefeng.wang@huawei.com, sunnanyong@huawei.com Subject: Re: [PATCH v3 -next 09/15] fs: fs-writeback: move sysctl to fs/fs-writeback.c Message-ID: <20241014121427.vuebknsmdlrtbveh@quack3> References: <20241010152215.3025842-1-yukaixiong@huawei.com> <20241010152215.3025842-10-yukaixiong@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20241010152215.3025842-10-yukaixiong@huawei.com> X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: DF07840016 X-Stat-Signature: km6exxjn8mfmm8jw6z19t3dy988tyyjx X-HE-Tag: 1728908064-767185 X-HE-Meta: U2FsdGVkX18O8rKWBYYOUsa4Ll4zkd5PptZrn7E2XpfqC1YFn0tQS7ZkI5fWhurKejNBQ7l2hfRlEvqP15dp1r/uZf7Wkgttpk9wG1nBbr8bRza2PMoYQodkqsfttlneP7kOjjXDTyKx8jSzrlx5+ESI8GMsZIIRnQ8ztlQaDaeLkUZbrL6/oZUSGjoOZAwru4YoBcLQ5JdfHzzT9GVgj4N9KhUmsuLmbO2fVAv4zhVMNxH3p0p40SbcwqN53C72W39lDzB6Gt5Zgwmqn2mGrF/HR3xVIPQqzKPQUqt0N/QQ87hUlE09q3/RhhtkDllIWtzBpRkjG4wXPN+LaSuj4AUMvmE7OeY90BV3KpG5htYhg4anUD854q0/NPHQu5+fhi72qNy7jgJH1SiLURoK8hPRRSYdRkNtH0l+93O6Ux5jZUkvg4Mk3prehUi5XbGN9yMDkCLWsqvi7aF02ltq3B6FPpOfrimSK/IbXcPBkWxzsTfxcuLxL2F4o0n278Je9dWd5riDu6Og+illDGRwzmXNHZmjFYqx4I6kAXVyOkPQVleftKFbDx2SxBdECCmCXtD0j04LimxMrsb47OT/SyGkwVrzXzLmz/ID0U1Molr6XkTDbPfFS0Rp0zdsOCbh1pBHMECNW5XrbFePUnmCcobD5aL8GMkV36LXLOBf8iqzLPSCRMrforXjyIo4lzdNPIQYOuydtbCHVMlGWXup5AaeSQ0kh+WEjmKcflzT2B0mRl20bBoEB3/CqeShtNqPTD1GhGmLvA1jAiz/VaSUw7q8pPKUAbGkJwfxBeyhAVS/Ub6mRvDdDsMDZBoqTlUNjkZw5U+0Zo3VID1IAAPlgooc+69XI0AoXo9ohBr3op3omeIugO0OJpZovZluSxODRpaMW43RFLJqz9SR/3JEvQ5lgej6UZRAHENgwn3KIOkFag69IpQm6N/TGPYUu8+6OHWdrXacHwWe0XA9hAa kSnPPH+o eTvBQIwItEgbi8QV6Omf3HTYacqZzcEitMC06VxLV0EvWjdKLTSZIN8o7zYmv9eVN+G07uOaF2ZIU+BIcn8EHv5P3M3mQHu87ZVE3WLNEgQsiAx2CcqyLvXROeTdRwrWpfpj7SaD51I6JHRYpzePupkobnEf+E77kFeuOMuaQ7DiVdAd87qmeK31l0Y0cpgK6G3EpMN6g957Lg9Lvq7l8JNSxgagHxDFUzdTMop8V1c8Q16mldSmiE/jrQk4+r8xdeerhXfql5QlxPThXX4+Q7jY77Pes60eZquI7FhQ15Pq7YjFaQNj66uhrWqBD2myaWGIJW1OhxpAEt+En2rrjCYFR7pZdbYbesVSNm32SrujikE9ham9i+zg9mPFYYsFLWMR+ X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Thu 10-10-24 23:22:09, Kaixiong Yu wrote: > The dirtytime_expire_interval belongs to fs/fs-writeback.c, move it to > fs/fs-writeback.c from /kernel/sysctl.c. And remove the useless extern > variable declaration and the function declaration from > include/linux/writeback.h > > Signed-off-by: Kaixiong Yu > Reviewed-by: Kees Cook Looks good. Feel free to add: Reviewed-by: Jan Kara Honza > --- > v3: > - change dirtytime_expire_interval to static type > - change the title > --- > fs/fs-writeback.c | 30 +++++++++++++++++++++--------- > include/linux/writeback.h | 4 ---- > kernel/sysctl.c | 8 -------- > 3 files changed, 21 insertions(+), 21 deletions(-) > > diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c > index d8bec3c1bb1f..4fedefdb8e15 100644 > --- a/fs/fs-writeback.c > +++ b/fs/fs-writeback.c > @@ -65,7 +65,7 @@ struct wb_writeback_work { > * timestamps written to disk after 12 hours, but in the worst case a > * few inodes might not their timestamps updated for 24 hours. > */ > -unsigned int dirtytime_expire_interval = 12 * 60 * 60; > +static unsigned int dirtytime_expire_interval = 12 * 60 * 60; > > static inline struct inode *wb_inode(struct list_head *head) > { > @@ -2413,14 +2413,7 @@ static void wakeup_dirtytime_writeback(struct work_struct *w) > schedule_delayed_work(&dirtytime_work, dirtytime_expire_interval * HZ); > } > > -static int __init start_dirtytime_writeback(void) > -{ > - schedule_delayed_work(&dirtytime_work, dirtytime_expire_interval * HZ); > - return 0; > -} > -__initcall(start_dirtytime_writeback); > - > -int dirtytime_interval_handler(const struct ctl_table *table, int write, > +static int dirtytime_interval_handler(const struct ctl_table *table, int write, > void *buffer, size_t *lenp, loff_t *ppos) > { > int ret; > @@ -2431,6 +2424,25 @@ int dirtytime_interval_handler(const struct ctl_table *table, int write, > return ret; > } > > +static struct ctl_table vm_fs_writeback_table[] = { > + { > + .procname = "dirtytime_expire_seconds", > + .data = &dirtytime_expire_interval, > + .maxlen = sizeof(dirtytime_expire_interval), > + .mode = 0644, > + .proc_handler = dirtytime_interval_handler, > + .extra1 = SYSCTL_ZERO, > + }, > +}; > + > +static int __init start_dirtytime_writeback(void) > +{ > + schedule_delayed_work(&dirtytime_work, dirtytime_expire_interval * HZ); > + register_sysctl_init("vm", vm_fs_writeback_table); > + return 0; > +} > +__initcall(start_dirtytime_writeback); > + > /** > * __mark_inode_dirty - internal function to mark an inode dirty > * > diff --git a/include/linux/writeback.h b/include/linux/writeback.h > index d6db822e4bb3..5f35b24aff7b 100644 > --- a/include/linux/writeback.h > +++ b/include/linux/writeback.h > @@ -351,12 +351,8 @@ extern struct wb_domain global_wb_domain; > /* These are exported to sysctl. */ > extern unsigned int dirty_writeback_interval; > extern unsigned int dirty_expire_interval; > -extern unsigned int dirtytime_expire_interval; > extern int laptop_mode; > > -int dirtytime_interval_handler(const struct ctl_table *table, int write, > - void *buffer, size_t *lenp, loff_t *ppos); > - > void global_dirty_limits(unsigned long *pbackground, unsigned long *pdirty); > unsigned long wb_calc_thresh(struct bdi_writeback *wb, unsigned long thresh); > unsigned long cgwb_calc_thresh(struct bdi_writeback *wb); > diff --git a/kernel/sysctl.c b/kernel/sysctl.c > index d3de31ec74bf..373e018b950c 100644 > --- a/kernel/sysctl.c > +++ b/kernel/sysctl.c > @@ -2024,14 +2024,6 @@ static struct ctl_table kern_table[] = { > }; > > static struct ctl_table vm_table[] = { > - { > - .procname = "dirtytime_expire_seconds", > - .data = &dirtytime_expire_interval, > - .maxlen = sizeof(dirtytime_expire_interval), > - .mode = 0644, > - .proc_handler = dirtytime_interval_handler, > - .extra1 = SYSCTL_ZERO, > - }, > { > .procname = "drop_caches", > .data = &sysctl_drop_caches, > -- > 2.34.1 > -- Jan Kara SUSE Labs, CR