Message ID | 20230308083311.120951-4-wangkefeng.wang@huawei.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp207468wrd; Wed, 8 Mar 2023 00:26:51 -0800 (PST) X-Google-Smtp-Source: AK7set8ccFh0TZiHMNcEgC3/iYkq+m7TwxxUbdxQ2JNlDznCC6g9tgOqAZOK//QQYU0htVLmka0d X-Received: by 2002:a05:6402:31fb:b0:4ac:c3c0:24d7 with SMTP id dy27-20020a05640231fb00b004acc3c024d7mr17369905edb.42.1678264011521; Wed, 08 Mar 2023 00:26:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678264011; cv=none; d=google.com; s=arc-20160816; b=tF2OXAkP37r4//KPLovtzADPPlrTdE+oEb7juoqfau7Cf5N2zpDG0V1BA4khunMf8P imLe6DYvxJovg8j5ruXovxvcVmobS9yGDrU/EJmW2Gw00+WKd/iSCK2ihQ0JnYBDRufi g09cdx3kXT4TpfYxYp8rBbR3jerwzlJDCv9B6hG1FVcZmxqpKdZgn9HbXr8anuuu6Sm8 q67/zP4qhgaSYhteNEfgqLk1sQEmzkY+Pn5GhfY2jROPWZi87QH0hLu38IsySfQuD9MT 2XFR3hZ40WrGOHvQvHMnWX34hw9cSQVBlFHKbvEL9TaU7bSHlXv+AMRec73VJZEUFSgX 5jIA== 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; bh=nACr05IkdnlTlwIhOKVQZNYjS9RH1sfG5PN/oA2Vl8M=; b=BO8s2z+0RSs3+mgkTxR3AW4Ekn13RSqA9AoeLrP1JTeikJDB3rTV7CCnWDhbVHd0GW BXweynNgO5S1IoaxdkdQw5APsMRtEd97xqCnSUbxFKwrAx1l7gsuRUBjT/9likMyn3E3 cq5yg3K9wNeFTUonf3aF7WLtW5qShXbKBWJHATbAVCLlzRRSeAAT92CrSV79GUL5httP XHt6UqRRAhjJiEp8+28JQHA6b/se5syoAZR/Sa+IlkmHgfXopA6W5Tx+h5ngWc1RB2YQ O15ssePgjL6Skm/vaz5+YV0Fy/ijA2WRDAslW09vuiGeQYcr8FYdOGF20Je7LKJR2hvB G5rQ== ARC-Authentication-Results: i=1; mx.google.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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l3-20020a056402124300b004acddcb7501si272792edw.116.2023.03.08.00.26.27; Wed, 08 Mar 2023 00:26:51 -0800 (PST) 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; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230061AbjCHINQ (ORCPT <rfc822;toshivichauhan@gmail.com> + 99 others); Wed, 8 Mar 2023 03:13:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53472 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230033AbjCHIM4 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 8 Mar 2023 03:12:56 -0500 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A4E4A18BB for <linux-kernel@vger.kernel.org>; Wed, 8 Mar 2023 00:12:49 -0800 (PST) Received: from dggpemm500001.china.huawei.com (unknown [172.30.72.54]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4PWlPG1fzPzKqMs; Wed, 8 Mar 2023 16:10:42 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by dggpemm500001.china.huawei.com (7.185.36.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Wed, 8 Mar 2023 16:12:29 +0800 From: Kefeng Wang <wangkefeng.wang@huawei.com> To: SeongJae Park <sj@kernel.org>, Andrew Morton <akpm@linux-foundation.org> CC: <linux-mm@kvack.org>, <linux-kernel@vger.kernel.org>, <damon@lists.linux.dev>, Kefeng Wang <wangkefeng.wang@huawei.com> Subject: [PATCH v3 3/3] mm/damon/paddr: fix missing folio_sz update in damon_pa_young() Date: Wed, 8 Mar 2023 16:33:11 +0800 Message-ID: <20230308083311.120951-4-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230308083311.120951-1-wangkefeng.wang@huawei.com> References: <20230308083311.120951-1-wangkefeng.wang@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.113.25] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpemm500001.china.huawei.com (7.185.36.107) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759787364023327447?= X-GMAIL-MSGID: =?utf-8?q?1759787364023327447?= |
Series |
mm/damon/paddr: minor code improvement
|
|
Commit Message
Kefeng Wang
March 8, 2023, 8:33 a.m. UTC
The *folio_sz in damon_pa_young() will be used(as last_folio_sz) by
__damon_pa_check_access(), so it's need to be updated, fix missing
branch.
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
mm/damon/paddr.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/mm/damon/paddr.c b/mm/damon/paddr.c index b22f6fbb5816..467b99166b43 100644 --- a/mm/damon/paddr.c +++ b/mm/damon/paddr.c @@ -134,10 +134,8 @@ static bool damon_pa_young(unsigned long paddr, unsigned long *folio_sz) } need_lock = !folio_test_anon(folio) || folio_test_ksm(folio); - if (need_lock && !folio_trylock(folio)) { - folio_put(folio); - return false; - } + if (need_lock && !folio_trylock(folio)) + goto out; rmap_walk(folio, &rwc);