Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp4968415pxb; Wed, 26 Jan 2022 01:40:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJwvm2tR2x5wQPFZgvI48N1o25CQW3m90RBgAqABleMEvTVGxqu+HrHgs2+g/0Kb9U7ijpVT X-Received: by 2002:a05:6402:21d4:: with SMTP id bi20mr23834253edb.20.1643190030655; Wed, 26 Jan 2022 01:40:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643190030; cv=none; d=google.com; s=arc-20160816; b=ZfTK7jwA/SnGJJakzoUjzbT/C/zVcTUrGFQcEdi9kQ7Vl60RnJInSU+vL5qRQJcv0N rvxD9DS0pS27U9Q6AnxKO450sP1iUaRwSM7LuCEXszVosxIt6JaXhFHpggk2oFfqnYSJ +fula1R+oUtx2cao+RV10n3+STl5uaITLtUQ1PkFeEhGETy64a9OR+gmosUTbeeL7uxM LtNBND1Hklm3WFUPZVlRVlcLZzNgAoEN57j8NLZd5yoXORr2VI4K/OOAbvzcNM2vv+Ac Y+SLf4Vf78Bx4ZeL3bpNF+/4CdFPDCtQ0SmpJR2/bEk3YSskb5tIAYfoEznAGkbbPms8 rMJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=I5imAOA6gMJ2Voc7H/Ixwoqs0J+xlDSEyK/v+m4Mpao=; b=V+1XC8ASdf2jPiRQMo2L/mUERHVKyVxA9n9E7w6K99vwtgnQbmV8FkNn4Ej2/tZOAy dkPH8Hv8HZiz17Uvo7dwvyjx1YJn+sd2IOLZxh2RbBEEaOnqTubKVALehnLbWS2qFR1H 6Wiudm1lbh+FaE3pvvj8iyBM/r6a7ljQx3q9gVBITUtpsWOB/pPzKxDsgnwvVm72Uvlw se8pkAS96E+DqGftkoSxG2rCiJwp7KeVDWjI78YEwXvSHnQqdCOWH5lgSAdCTKmcPZ3B oNHqdB2pjID4GgcHRZPNEeN984WV8MuSl0d/JBH3ftI9I3YAO55P/y4i7DWyhc/mkgbD G33g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=spiTYMZr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j13si1891567edw.174.2022.01.26.01.40.03; Wed, 26 Jan 2022 01:40:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=spiTYMZr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231854AbiAYUXI (ORCPT + 99 others); Tue, 25 Jan 2022 15:23:08 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:58722 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231775AbiAYUXD (ORCPT ); Tue, 25 Jan 2022 15:23:03 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 2D4CDB81A2A for ; Tue, 25 Jan 2022 20:23:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CD945C340E6; Tue, 25 Jan 2022 20:23:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1643142180; bh=ofAycFRhfggnQ8vC0SVr08d1Hq7S/JeroNDpfQa4dno=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=spiTYMZrR/hipoHCjyv2pboNqs5CtD0mXMXOqfK3MmXpZnjViOMQOS24FZrnqeX7V ogLwF0EA7iwCASRL+TbsGBuHoCmN37Ba/qL0OqiraktZkNjieZpDgRgV5GArMP4mPW HOxep14tpwnwQw3eJgpQKaC/0mI3H4EfVLVSk/R6DtrXQvRZE9Ik6R+OQDuPlcc5n5 OpAdy6jM5NER+P1gEUzLkCWTKPogx4AOM+f9yUkce9fiklNzaYDDIl78aUMf+5lzDD 57CAgJow841eOGaoGs6SVXtVt4j9B0OE5Lmv7/LQhxYhd1ZMQwkpGgVngDy45Z09Ps KlZHVY3HcXHlQ== From: Jaegeuk Kim To: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Cc: Konstantin Vyshetsky , Jaegeuk Kim Subject: [PATCH 2/2] f2fs: expose discard related parameters in sysfs Date: Tue, 25 Jan 2022 12:22:54 -0800 Message-Id: <20220125202254.3111474-2-jaegeuk@kernel.org> X-Mailer: git-send-email 2.35.0.rc0.227.g00780c9af4-goog In-Reply-To: <20220125202254.3111474-1-jaegeuk@kernel.org> References: <20220125202254.3111474-1-jaegeuk@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Konstantin Vyshetsky This patch exposes max_discard_request, min_discard_issue_time, mid_discard_issue_time, and max_discard_issue_time in sysfs. This will allow the user to fine tune discard operations. Signed-off-by: Konstantin Vyshetsky Signed-off-by: Jaegeuk Kim --- Documentation/ABI/testing/sysfs-fs-f2fs | 27 +++++++++++++++++++++++++ fs/f2fs/sysfs.c | 8 ++++++++ 2 files changed, 35 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-fs-f2fs b/Documentation/ABI/testing/sysfs-fs-f2fs index 2416b03ff283..87d3884c90ea 100644 --- a/Documentation/ABI/testing/sysfs-fs-f2fs +++ b/Documentation/ABI/testing/sysfs-fs-f2fs @@ -98,6 +98,33 @@ Description: Controls the issue rate of discard commands that consist of small checkpoint is triggered, and issued during the checkpoint. By default, it is disabled with 0. +What: /sys/fs/f2fs//max_discard_request +Date: December 2021 +Contact: "Konstantin Vyshetsky" +Description: Controls the number of discards a thread will issue at a time. + Higher number will allow the discard thread to finish its work + faster, at the cost of higher latency for incomming I/O. + +What: /sys/fs/f2fs//min_discard_issue_time +Date: December 2021 +Contact: "Konstantin Vyshetsky" +Description: Controls the interval the discard thread will wait between + issuing discard requests when there are discards to be issued and + no I/O aware interruptions occur. + +What: /sys/fs/f2fs//mid_discard_issue_time +Date: December 2021 +Contact: "Konstantin Vyshetsky" +Description: Controls the interval the discard thread will wait between + issuing discard requests when there are discards to be issued and + an I/O aware interruption occurs. + +What: /sys/fs/f2fs//max_discard_issue_time +Date: December 2021 +Contact: "Konstantin Vyshetsky" +Description: Controls the interval the discard thread will wait when there are + no discard operations to be issued. + What: /sys/fs/f2fs//discard_granularity Date: July 2017 Contact: "Chao Yu" diff --git a/fs/f2fs/sysfs.c b/fs/f2fs/sysfs.c index 2bccdaedfb00..281bc0133ee6 100644 --- a/fs/f2fs/sysfs.c +++ b/fs/f2fs/sysfs.c @@ -716,6 +716,10 @@ F2FS_RW_ATTR(F2FS_SBI, f2fs_sb_info, gc_idle, gc_mode); F2FS_RW_ATTR(F2FS_SBI, f2fs_sb_info, gc_urgent, gc_mode); F2FS_RW_ATTR(SM_INFO, f2fs_sm_info, reclaim_segments, rec_prefree_segments); F2FS_RW_ATTR(DCC_INFO, discard_cmd_control, max_small_discards, max_discards); +F2FS_RW_ATTR(DCC_INFO, discard_cmd_control, max_discard_request, max_discard_request); +F2FS_RW_ATTR(DCC_INFO, discard_cmd_control, min_discard_issue_time, min_discard_issue_time); +F2FS_RW_ATTR(DCC_INFO, discard_cmd_control, mid_discard_issue_time, mid_discard_issue_time); +F2FS_RW_ATTR(DCC_INFO, discard_cmd_control, max_discard_issue_time, max_discard_issue_time); F2FS_RW_ATTR(DCC_INFO, discard_cmd_control, discard_granularity, discard_granularity); F2FS_RW_ATTR(RESERVED_BLOCKS, f2fs_sb_info, reserved_blocks, reserved_blocks); F2FS_RW_ATTR(SM_INFO, f2fs_sm_info, batched_trim_sections, trim_sections); @@ -832,6 +836,10 @@ static struct attribute *f2fs_attrs[] = { ATTR_LIST(reclaim_segments), ATTR_LIST(main_blkaddr), ATTR_LIST(max_small_discards), + ATTR_LIST(max_discard_request), + ATTR_LIST(min_discard_issue_time), + ATTR_LIST(mid_discard_issue_time), + ATTR_LIST(max_discard_issue_time), ATTR_LIST(discard_granularity), ATTR_LIST(pending_discard), ATTR_LIST(batched_trim_sections), -- 2.35.0.rc0.227.g00780c9af4-goog