From patchwork Wed Mar 8 08:33:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13165366 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 C0F95C64EC4 for ; Wed, 8 Mar 2023 08:12:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9015E6B0074; Wed, 8 Mar 2023 03:12:56 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 8D8446B0072; Wed, 8 Mar 2023 03:12:56 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6405C6B0075; Wed, 8 Mar 2023 03:12:56 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 5175F6B0074 for ; Wed, 8 Mar 2023 03:12:56 -0500 (EST) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 21E181207F3 for ; Wed, 8 Mar 2023 08:12:56 +0000 (UTC) X-FDA: 80545015152.15.273980E Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf25.hostedemail.com (Postfix) with ESMTP id 4EE35A000E for ; Wed, 8 Mar 2023 08:12:52 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=none; spf=pass (imf25.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1678263174; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+Layu/iSxbaCwl2EtiPPzTOBELCa4Jr3rf2UxbUwrao=; b=7M6/1bI2g7wMyb4YgZSocnvXfNBvR8VrhtHHdH5LLb/2+/8D5GWrc20j/DHiOZRCOiQZWS 01yskw0cc8irKNWRE5PpHJDSIx8UkBHis+5RkD2wkdldUfxhhCsHBwlx9Ju73wOwU2gnlI qFlw+5sJcnnz6Pl4TXpAYl8jLxglPFI= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=none; spf=pass (imf25.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1678263174; a=rsa-sha256; cv=none; b=MC3nWFuQSKA8rH4C8n58kmZttp0hCrs7Owzf2Gtrk1yAUhWjLGqszDbehMxUHPjD1cNORz AVAevSGFb/j0On6BC2SnbLQYAS9t+Ba78Uz7PGXHygH508DTsliPx4Q08NrFIQzTaNg/Nj QZwCSquqYfkYgjW9RiephtCJMMHQeoM= Received: from dggpemm500001.china.huawei.com (unknown [172.30.72.54]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4PWlPF3z9pzKqMt; Wed, 8 Mar 2023 16:10:41 +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 To: SeongJae Park , Andrew Morton CC: , , , Kefeng Wang Subject: [PATCH v3 1/3] mm/damon/paddr: minor refactor of damon_pa_pageout() Date: Wed, 8 Mar 2023 16:33:09 +0800 Message-ID: <20230308083311.120951-2-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 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-Rspam-User: X-Rspamd-Server: rspam03 X-Stat-Signature: fmduahsf7e6x6yxh9o8z8cgknrso6kfc X-Rspamd-Queue-Id: 4EE35A000E X-HE-Tag: 1678263172-48797 X-HE-Meta: U2FsdGVkX19N2yuW8PozNRkxlskhwA4+yxIlHtybElCZJe8MkwzBwGx6msyWja0CAxOTvOGOM+wcZ+L00ZXGK8mQ6IwfcaEdfa8/TcRgIZX/Ao2YLOLTtw+n/xm+BZ7WMNiaPsWgVmGng+mPFg9WroOgZG4MJutiyYJKc2CyKTkt+M7DS0/W8twhlLlXuap06dRgoPXV7JJ0JwquH5+5Lb7Kwkkt3Rzp4V2ZmVHYWMyn5H+WvrfyQW9QYpgD1OfKgj4agMGX5uo/LF4oE/2wRBW1YFrtjVHkki1zXduzSHwgkQvxJWex5CBzUaWq3bdqD6nGo63CSezRkMw1aRXFWG6qJCooWmOO5RaytPfJ+Mq40v2kBTsrRaCCynXTKJVyBXVAqXDZqNqLMVMtrb0Bu57ZLOx9wlndwNmjWEekyFHrrm7vKU+jNn3aEXc8udppQfm83tDlIQ1F1wyfwcaX52s9tXv+aP8xeITyYrI1xcmPAkUcGPLBdCRahCli5AiZoUVUGAYAwwT754sFSYRAa4U9Bav7T7AV0heu0YKE4I00Q2ielpskg7HPLCRvWgEbzmWIVcdFvqK1PTAC8EsNoQEIb2oStbGiv8aq0OVE1YiNsg5uja+05yLGuKWmxukLmcHOzpLK/bo00uVkreSwq+MdHCCBh5nSzBnNgDprfee9SzTMskabPrDaMWXzJeWxxwAsDVHddWkOlcAPfBXVntMia4stmq/RE4QwqsGxLw8zuPCjUQ/uPOfE5g7tltxfal2DLtZ3XamQ9Qau8Q52WTAs8TlZAu00D+dZdxJWU45vZ+8Y4Ov5StpZvJ7zeUqX0Ao5uK7NLE//vwizwaOjp0kJ5wzzuW7V0VX7Mq2laAKJ75TEPJ+7ooslSW365mK40vv/llK0HHZK4raQGnDzKQligVSY8PIuD1HH5HDSjbiPsMT4hb0xAwBka1qvZMJO2+LL0LTO2MKlzO3w52z BoSUgxyg bmxw7TM7FPv/HKTTOl2bdMQCYB2IlK2jtwrn+Uc2Nn55JtoeDWvJd2p06kKMN2LeAifKaqiZAgTzumKwmfHl8aPm+sVPnLo5juOLqVlKbHr2EHJVtDcepRxV7wG9MeONZLRBYlL80KJ3R+A0vyFGX6VXpmePvcYnGk/ZKNU/9apOW8uNI2c2CLAFJwJs5JMDOaEXeXbVxC+WM8+fYz2ZCDAIXdNva9MHXu2ZX4SjR75xOZGKj/6HsGUE9E72CiYWbIzjxoycQVQf1wyA= 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: Omit three lines by unified folio_put(), and make code more clear. Reviewed-by: SeongJae Park Signed-off-by: Kefeng Wang --- mm/damon/paddr.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/mm/damon/paddr.c b/mm/damon/paddr.c index dd9c33fbe805..0db724aec5cb 100644 --- a/mm/damon/paddr.c +++ b/mm/damon/paddr.c @@ -238,21 +238,18 @@ static unsigned long damon_pa_pageout(struct damon_region *r, struct damos *s) if (!folio) continue; - if (damos_pa_filter_out(s, folio)) { - folio_put(folio); - continue; - } + if (damos_pa_filter_out(s, folio)) + goto put_folio; folio_clear_referenced(folio); folio_test_clear_young(folio); - if (!folio_isolate_lru(folio)) { - folio_put(folio); - continue; - } + if (!folio_isolate_lru(folio)) + goto put_folio; if (folio_test_unevictable(folio)) folio_putback_lru(folio); else list_add(&folio->lru, &folio_list); +put_folio: folio_put(folio); } applied = reclaim_pages(&folio_list); From patchwork Wed Mar 8 08:33:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13165368 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 76288C6FD1E for ; Wed, 8 Mar 2023 08:13:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0C5A46B0075; Wed, 8 Mar 2023 03:12:59 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0762D280001; Wed, 8 Mar 2023 03:12:58 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E0B106B007D; Wed, 8 Mar 2023 03:12:58 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id C6ECF6B0075 for ; Wed, 8 Mar 2023 03:12:58 -0500 (EST) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id A124EC0658 for ; Wed, 8 Mar 2023 08:12:58 +0000 (UTC) X-FDA: 80545015236.26.90D80A9 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf28.hostedemail.com (Postfix) with ESMTP id 719E0C0009 for ; Wed, 8 Mar 2023 08:12:56 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=none; spf=pass (imf28.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1678263176; a=rsa-sha256; cv=none; b=eSnLkYBeM6iId5E4ZT/nsqZ/ozQIkUwntSms0PwUT94fFlKZIQwBbQfByRcMds//9OkJQ2 tG1lIhfczJDGpyxJcKLotL36NuSF7/SK3HRd7fIJbtAYG7oYbk2Tt3jcvXnMhiVndwSFTt 4JNN3mRjYv0ZHl/xQDvreBCoSvQIZ9E= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=none; spf=pass (imf28.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1678263176; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rxxvt2ZY/2w1vBgoz+ZTt/7u5whq/ogITHKZHoaklEA=; b=AaymGP/NLFTEWqHCKSXc9IuZZfE0aJZ4RVPRhBRsEnxRZ74k7vcrUloCJJMnVXrQKUyrQk IwInZsF1ElawRWK12YoJ3JydXcUaXQ1fnbONB4zjj8aeXTNo49WJndo6/iw6h4xCBeWGgw 93tkdoH6C7V3kpGdKPhbCPbapvLOpZk= Received: from dggpemm500001.china.huawei.com (unknown [172.30.72.54]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4PWlPG1NkyzKqJm; 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 To: SeongJae Park , Andrew Morton CC: , , , Kefeng Wang Subject: [PATCH v3 2/3] mm/damon/paddr: minor refactor of damon_pa_mark_accessed_or_deactivate() Date: Wed, 8 Mar 2023 16:33:10 +0800 Message-ID: <20230308083311.120951-3-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 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-Rspam-User: X-Rspamd-Queue-Id: 719E0C0009 X-Rspamd-Server: rspam01 X-Stat-Signature: qwwjc4emodw1xfon5uq8r5t41dznpkm9 X-HE-Tag: 1678263176-32213 X-HE-Meta: U2FsdGVkX19SBug4CaiP4OHZ0yCfflcJjDuLfhdYdA9IM1nVsdf5WMuIJe30XVG0dWT2NRfV8PYh/oEBHZ/KHftkJfJwnfv2xEZDPTGp6aWOx+MwwJbgBYG105vyrSd61aYuocOgt0CBUj88JODsxt1bXRYEA1gPA5IASTxb4ixEeGZPxQSAG1/1L6v/TYIOMc+OgtTDVC+Rx8BT0jdq7Fp4WLIyY3AB3rU7hH3zvsRhn9FXKiX3yQgobR8dlg/04NYrS+FnZ06y+z4Z7cFzYKmN96odsBeCKkfhen17sSDrBzuoitWhFWwrTE+F1RC4XI6A5hMN5f7r5lFVQfqlXiOP/QTibGSLG/gVHSEBMXMH+OQQiGtXJsdziSzH/Xmo5YKCudzLs+1J7ZubbnBmAEwQsmTN1zVFgKVqioBvz3rT8crJ86+g6qbS7634LEsiQ+wnXGVUDvxlfIM7EhlMWcAcKN7kdpS0cxRwQH8HAMFxgk20UVhD1ePI9lkC5nUptRnRmRxZUIwt1/5oQyRP4dqS83qn4IGmsBmWluR+jePkzI6VircYLVY+E3xuJeW2JzbndIdIqW2tHH4cPPeT++qo+UHFeEhAiYEff6fdZsyUrweABiuxc7vA4gxxSf50WMmCq3PHG/nC4Qc6zfqwm3uWYzg4lBJRplemvQD2HPjU83/ipvKFJjVF3Git7Oqs4P27oi5zofmIVxSuh2ABcF1m7kFUXvajDHwZthZQUDqIHUGYczYBxWPUz2wgsfT5zadEVtHOpKxc6Z1qsGONvje/R2k0I54KYcamXsTxNFNmO85EyLsqUMdCE9W5YzU/DipZxrfeD4Un6iA3Vh1lHmYs8IS7rsgdAAm6eX79s8H9j+G09AKGCOTbv1ujI+1g+EYHXSaTC/W049OecHa+k1YDG+lrjlln+tfDxupK+mZDmrqwfy2bR+4Ox/V/2jbpDq6YyE1P/cTl+iMvCMc NvuHQRPU TftJsed0j/Mmp9ujSsSHzD4CYZHZwDSVQBGUB6bs4n0HlDhm7vkeZ/lvaPq+j6t+aZ/SS5QH86p7io5UbPJF9+UY8a5wB4Tbw2Deek0Zv/oYJNv+crfhBcOv8AjYoGVHjc4UHHNg0nCX25ildOmovVL4Mu5X3O3f1oKkokCy7a1n/Zz3decsS0lTOuXFTdMu9cGCJYEyJYOBSJmkjUdjTuLS9rg== 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: Omit one line by unified folio_put(), and make code more clear. Signed-off-by: Kefeng Wang --- mm/damon/paddr.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/mm/damon/paddr.c b/mm/damon/paddr.c index 0db724aec5cb..b22f6fbb5816 100644 --- a/mm/damon/paddr.c +++ b/mm/damon/paddr.c @@ -268,16 +268,15 @@ static inline unsigned long damon_pa_mark_accessed_or_deactivate( if (!folio) continue; - if (damos_pa_filter_out(s, folio)) { - folio_put(folio); - continue; - } + if (damos_pa_filter_out(s, folio)) + goto put_folio; if (mark_accessed) folio_mark_accessed(folio); else folio_deactivate(folio); applied += folio_nr_pages(folio); +put_folio: folio_put(folio); } return applied * PAGE_SIZE; From patchwork Wed Mar 8 08:33:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13165367 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 E7695C678D5 for ; Wed, 8 Mar 2023 08:12:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B91CD6B0072; Wed, 8 Mar 2023 03:12:56 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 9E9506B007B; Wed, 8 Mar 2023 03:12:56 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 812D5280002; Wed, 8 Mar 2023 03:12:56 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 4F11F6B0072 for ; Wed, 8 Mar 2023 03:12:56 -0500 (EST) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id F1AC4160323 for ; Wed, 8 Mar 2023 08:12:55 +0000 (UTC) X-FDA: 80545015110.15.4A0FC32 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf29.hostedemail.com (Postfix) with ESMTP id 93D3812000D for ; Wed, 8 Mar 2023 08:12:53 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf29.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1678263174; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=nACr05IkdnlTlwIhOKVQZNYjS9RH1sfG5PN/oA2Vl8M=; b=cEmCq2ntEc20JH0FHKUA9wBmsmX7Y8SRAXL9NNOqJPsEOQfbe/DCSBqLipqmOAl5QX6gqe lfsZ+c8Ppf0OHffI9zMV6bdtSpf9oGqJt44BsCtOWOfTMGzm5/XjWNno6VyRvKhlF8VNwO lhjuhtGMV2yYfBjCm/j25jp6jZj8dSs= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf29.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1678263174; a=rsa-sha256; cv=none; b=D6EcChlIWXQ8kEE1hYjD2/yrTYGtoNLkHG9+swraFJxUSXNhZrdIN6PscDTN3w8FmT5w2g ktonyKvL+B5gxknT6AkNL3Y1T4GGRQB1ZM3Gs3Nkr8Y8ob/aUyDWORQ8Err2bUcoo8xukH hGG+5r9vbuFEkJbCD8Z+mFSUkMR8vL4= 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 To: SeongJae Park , Andrew Morton CC: , , , Kefeng Wang 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 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-Rspamd-Queue-Id: 93D3812000D X-Stat-Signature: xj3rurg87otn51iqowana36hyec1tokq X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1678263173-337808 X-HE-Meta: U2FsdGVkX18CIIPGjRfSIC1YYoIm3qrwkbf1MbA2LtnwY2SrqoPKmPehZjLbmxPESvXU3o5rCNTj1/IVC8Jy4O7lxP4pUxCYm5n3lv81tNvwa1EnlcR38KjyhdlDJzfyMoYWWzEkliEAO15blAIVLdT2mkl3ih37NCNYpIsuiFdURLq/1cvRzTWEf5KjBvoEKMbaJzcFjwSKEG+ndpzhftB8Fa/x4af2zTTd7hroNFIAuvQTIesqLvRtgHcfZ/OrhcMItQucyb25BnxPf7NP9+mkT9edFZsngAkGlOMklWYykqzgkmZN8zyOgwNaQbwzBP+p3upvw9MPY56YkP9yLRIYkdXJ/ngA08wTb/jz5pO9KCQ48yxvu4L20/+C/ndtXfcLuAEwArQ8o3B/PIF/u9P+slHxmNsucQEh2AUDkUyiuKu+QNd7q0zI2jmEQbOLQjelypZ37rYpwLrvXPXosbv4qw4nuP07YcAz+E28osDG9RY7WfpW8OLXhAyYMDGWs+lglsrKjNiDW2PHl7H7sSTBN24riCAUC8W0/JsaE9RJXUCNIwexoOD9AF/uQRyiC3Fo9NjvNNJ8lme3BDIc+eQFZlk5UwSuGWbPf/kjDP9p3eRA+fYKJNRKYgkm45b1/tdD0oKjzL1/koJTf76W3DatM734EVGHXpllBMqRTjIxSbHkoNdEKsbPgbdQtGQshLo/st+A0QTgEUHPP6UlB/1MGCmLh+P0gPjwVPYF1O9ADaRPYBRH1F0nONytIvadvcMF5eg+M0skYFxO5oaZ1FQ1xvoXSCdxhRLf9K7RLNYV8KoOp0Nr+6H3jT7ZH8sDublwoZgkK4bCcWHJ6m37dlV+hXJPIznf9Q81fqM6rVzA/pgbEfHM0oFRZ3QagE/ngSn+78FbNeXckEk84P6llyr8uNVVpc17bxAiqRpgBv2klqH2w2hqgl0LY+VbIhrryGxY3mclrkrI2HB9lo/ otu6frku UPssPXnfBb4WjJjyKusbXL+vhRh3TopTDsvWkJOeEVqQ/0+gouVa37cmYmR+qEbNmxMC/xyPnj6TryZGZA9woa+bf5xuAOxv9zOEUk51+lxgw7DGDxo7Pz91/a0w4ibuKk0GiLzuFFaivCodR+JxuGoqNzaJbPUFgexrQ9jZvfuhJOaXwouGPzmm1Y+Rh2Ksftqss2Ap9SVyooP/xCxNzEEaoZw== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000042, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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 --- 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);