From patchwork Fri Oct 28 14:37:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?5p2O5oms6Z+s?= X-Patchwork-Id: 12366 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp871429wru; Fri, 28 Oct 2022 07:45:44 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6/eOp29l3AUlwzutNjRT6c/hCLKNJD6g0kpBc4oC7lHaPKGoxfNAi4JX7OePEDT2AmKd+P X-Received: by 2002:a17:907:b16:b0:7ad:855b:c08c with SMTP id h22-20020a1709070b1600b007ad855bc08cmr10913708ejl.667.1666968344065; Fri, 28 Oct 2022 07:45:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1666968344; cv=pass; d=google.com; s=arc-20160816; b=ASx2QZXy91lo2jAPitGAJQoAXDZ/FMQ0m9LK9ZwKRKM+LVM4f5txw9HAn5y8RPlZeY zTDl7vD20OJI8aHk0SulLNebRhyZosGvndYIR1KpmOVaQJlsfXtRsvv5r1LKQjSnSwgM gqdmpRytROmObfpC+FSCiFHvPkMFAykz4USjG1CgteZ2zNEOeX8MXSiDtPaOYLKpe/m1 r9EXrrEb8MJR+vCUbBihZjwIoL/gJbUWJ5fjh+fHGdrBY8Y4BO7NEyGBSmfgMUJpBdp5 EDCPrhxsq4YF2NmBobkd38MS4qjvwTjRxqxZtHB+IYn82mZ89Uzo8s3IHZbtR6Hp5nBk YbWQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :message-id:date:subject:cc:to:from:dkim-signature; bh=ZAakm/77XKiI0neJGVxwHr9h8bEyPZzbC+sWixZCBNU=; b=JkNlhpfBEDmRBqRBmfTDqsw/MkQQ8F4X7ZGsUy+1QCCgh0sjvB5K1qCHM/6Vpmbh0u cnLtrRngc9IsnwsrM9SZVDYcGQIuMuKdVKswoOHkOsGNACJiUQ/j9l0Q4iZ61dgwWAkn lwU4NKNA+SSYhoVLBJglFIqn0tHWqQaMJkPqtM7OkjlM0Kd32sf53jwTZqRylZlastrd lB5NZ23SUW1cprYNhdbvQPf/58elAfh1bPzWq3l4hP4xcbkRvvE8CmLPGjc/tlc3cXD+ d/YjlftYlWYdWBnhMdYg1H6MRJ93gyRs/NHhbwME0lZ9cJZGV+oa+5SPzyYyQ7rXx990 bHfw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=pZc7W+B7; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i13-20020a1709061e4d00b0078ded36fa42si4029219ejj.292.2022.10.28.07.45.19; Fri, 28 Oct 2022 07:45:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=pZc7W+B7; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230225AbiJ1Oix (ORCPT + 99 others); Fri, 28 Oct 2022 10:38:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36418 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230390AbiJ1Oij (ORCPT ); Fri, 28 Oct 2022 10:38:39 -0400 Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2119.outbound.protection.outlook.com [40.107.215.119]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C16EE6DAD9 for ; Fri, 28 Oct 2022 07:37:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TGHUeuVmJwplwVx8o5C4OPcAlYb4kljmSARyhXYrqkqJx4KoGRxyYDKR2hTd6T3q1RmjtSRaArdr8TUI2C1R2Q7ztXqIpkhs251dznezJ8SQrQaAd40hy2WSz6WbWFluxAgCZiUMPsi1VIHgE9jc5Mj5pG04CCd+isVVdssUrIlkMYMKu5aMluT6seeYH2bugu1lxLDsixrD7GgKh6cOIo5wGl5cXa0BLs0ar7CqU2g94IZ7uhGzfP7r2rhn5Zh28lirn4adjAujXycJCWXEDVt8vSIMFMIZ/siighzQT1x9zi8QFIwiRcZGNMM+RnU0XMRda1XcI6o4UNG3vOkTfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ZAakm/77XKiI0neJGVxwHr9h8bEyPZzbC+sWixZCBNU=; b=WB9Rxnl3N2C3dvQ5swjKVZT57yrvJ5XuPqN+A4jbmcs8qGNWKFkTbtPMDoSXg4dpls+RXtyfuWMbmtWTphsOL/14owcSbpIalIfAtCNU5n9xQ6ui6ubZQ/xOZx8CW1UoEvgIkchLUEJJHcPw+da8K6Vmm5TUYVSGSVE0uaIJsbhv6fXvnsWPwImLrcIaiMz8SalnH21uI8AT8G11SiRWbvl/E00RlyP4R5V6ODGkTcuFY0+WDFp+d5sTOmJ2TkufefBjqYGYSv4299cUY1tn+OQu7enxx5fQdWEkSNfCRknr3wgUNHJJXLkgWzfhEq7IiV8WXWYo0EVWUsAyF7mDlw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZAakm/77XKiI0neJGVxwHr9h8bEyPZzbC+sWixZCBNU=; b=pZc7W+B7xv7IBfyEu1kziG7ZLC3h2KVj3ccYlnYAeb0W67xL7CEF7tFE4QiJdoz9poleZNPwWCaUUcL13ZsOVbJkbv4g7fUhg0ZEDqoS1Yp6mjFlH7wxh+g0I1dB4oo1NDgOtSb6NAw63OKXt61Hc9mdAE061uIaufJsWyTnymndfZHUMrMUZIuJCz4NPEpV6qPAjJ7pgzYWOXCfrdOhR6YUqE6tY6LqMjd7yd+DrScTMhKoJEPvq5oFknS+lRVlpKc0pspea2sK78yh5ogwWRLWS4UdcREYsNyIurBsZsPcN19B0Sx0OdwE3GWAHe2vykOkWyB448z2YMXuuoJ2rA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) by TYZPR06MB5099.apcprd06.prod.outlook.com (2603:1096:400:1c5::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5769.15; Fri, 28 Oct 2022 14:37:43 +0000 Received: from SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::c84b:5a6c:d66f:c0fd]) by SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::c84b:5a6c:d66f:c0fd%3]) with mapi id 15.20.5769.015; Fri, 28 Oct 2022 14:37:42 +0000 From: Yangtao Li To: jaegeuk@kernel.org, chao@kernel.org Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, Yangtao Li Subject: [PATCH v2] f2fs: stop discard thread if has fsck tag Date: Fri, 28 Oct 2022 22:37:33 +0800 Message-Id: <20221028143733.57322-1-frank.li@vivo.com> X-Mailer: git-send-email 2.35.1 X-ClientProxiedBy: SG2PR02CA0081.apcprd02.prod.outlook.com (2603:1096:4:90::21) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|TYZPR06MB5099:EE_ X-MS-Office365-Filtering-Correlation-Id: 68173172-295e-4cbe-36ae-08dab8f1f8a3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6tKgchvdjq4bysDW+x/i4QfExZ/z91RAKX2Cw8QxtmKRS6PEGYcx85ynxDQ0LY6h9Ub2LQruSoDGKoGrcdLOzluSy9FLVPgJXiEI2EqKQwwvzEJtHsc/otJ8CqjFBPvBdJAS3fDsXQEBQi302ym3VInGAydyiujcqSGm5hhPwQHxTwBDWT7AykOs0xHUjQG4HKXMsCMQnaQ8YT2qudORPofDJbimTSVL0krRpam0rlgKLV6BwMabnn0lS2ugzpeKW73AYsC81kDi0nirdjWn1YhXYOPOHhSXpaihjGf2aEQrBDzvDYHm3doBjDeblI6DsHuzkOu+mtjqL/Le83wkDrcAlCXbj+6guYzrqpBUurldLcZV5fYHCOgAg2pFY4+9bf+9rnPv870SiHFEeqOzHB49+THFVESFVvHPmGYL1aDOD950DclF/nZaAF3vbZjOHGrYIBmfCYpoBCS9tklMz0eQXvrpLNSqbnNKVFx2MMmKKxvg0BrD42ymZw9jntwze2GHI5Ow7TSS5EvEmlPDqxOPh9dFZpQJI4Y85Nmm+Qkr0I9AeO+XgVouYZ356iI9KLd072a0r2YLnnSXXaq0qTPsXF+yV5jlrrHDlR9ATAlnwuykYhVkcOfEEeYIMW0sWcixZpsg6AMr+cZU3jgixv5ejjkGBFu2rR3hegnbiuBYCIgpuFee5uGUWxRGiMYYG6xHAx+lQN27up6WRDXZZGu9UY4O29dm+V9MfJESqap+b+oVk4pA9o4ABWZ9FfVRnaNQmR/+lQCnXhZmUANUKw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SEZPR06MB5269.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(396003)(366004)(39860400002)(346002)(136003)(376002)(451199015)(86362001)(36756003)(38100700002)(38350700002)(8936002)(2906002)(1076003)(83380400001)(6666004)(107886003)(26005)(6506007)(478600001)(2616005)(6512007)(52116002)(186003)(6486002)(8676002)(4744005)(316002)(4326008)(66946007)(66556008)(66476007)(5660300002)(41300700001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Nq0s4VcdE4hSD6B2fluDw/uNhg8F6WrFqXmkPrLyjoECTdqydlqupXr1Cdz6oo8w9wYbrxanulpFH5lSOtXG8bKqi6bkqcNTB+60IgLmUz3n858/6ee8pk1kkq8gZIJQ604msFxgT20lp1yo3bEjhH6HLdrVprWL3g4LwfVaRYDsG94Nu9nkmruY2s6JyErSHyoI0IB0DoR7y56rjv/myWa1yxlwg1K3XNw093vsqlmNNOBdrDtXds3ivAG/yTYxRhSlusDqH3iB7piDpYoCgRt1JZKuDOYvOR7nVCRmpGx55ToyGyMLMOc0w6xqWIz7aAI9we25j5NAO4bGh2f3syqh4W3/E+yaf7EJwXlQd5xF/PUfzCy2ihYLytshl/dQ/13SCKmxARgV8UmUQANUwe0dK980uJMPSnaUfNhWA91kRlfqjAZVc9uMEW7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S+d+OuDu9oHCEnEevYZcsljQKr0NPv4kyBYCQqouCcQ3drMJ93oACw5yFqchJdKC2SR3CVbxQT X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 68173172-295e-4cbe-36ae-08dab8f1f8a3 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Oct 2022 14:37:42.6464 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: qUA4Uh/pDdxgc+4W0JJx4OgFRVRppD4AmMtxdXEasp5b4E4Gx6JDp9N+shfQbtEdJKmWDmIwKVc4GhWlLUEAFQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYZPR06MB5099 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747942998342517216?= X-GMAIL-MSGID: =?utf-8?q?1747942998342517216?= Under the current logic, after the fsck flag is set, the discard thread will still run periodically. So stop the discard thread from running to avoid energy consumption after the fsck flag is set. Fixes: d618477473eb ("f2fs: stop issue discard if something wrong with f2fs") Signed-off-by: Yangtao Li --- v2: - commit msg changes. fs/f2fs/segment.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 7786351de429..b3600bcadfc7 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -1716,8 +1716,8 @@ static int issue_discard_thread(void *data) if (kthread_should_stop()) return 0; if (is_sbi_flag_set(sbi, SBI_NEED_FSCK)) { - wait_ms = dpolicy.max_interval; - continue; + dcc->f2fs_issue_discard = NULL; + return 0; } if (!atomic_read(&dcc->discard_cmd_cnt)) continue;