From patchwork Thu Dec 8 20:35:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vishal Moola X-Patchwork-Id: 13068867 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 6F947C4332F for ; Thu, 8 Dec 2022 20:35:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3D76E8E0008; Thu, 8 Dec 2022 15:35:13 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 310BD8E0001; Thu, 8 Dec 2022 15:35:13 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 162188E0008; Thu, 8 Dec 2022 15:35:13 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 076408E0001 for ; Thu, 8 Dec 2022 15:35:13 -0500 (EST) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id DD6A2140B94 for ; Thu, 8 Dec 2022 20:35:12 +0000 (UTC) X-FDA: 80220293664.30.6E49CAD Received: from mail-pj1-f44.google.com (mail-pj1-f44.google.com [209.85.216.44]) by imf08.hostedemail.com (Postfix) with ESMTP id 1CC8C160007 for ; Thu, 8 Dec 2022 20:35:10 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Ii3vt0qJ; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf08.hostedemail.com: domain of vishal.moola@gmail.com designates 209.85.216.44 as permitted sender) smtp.mailfrom=vishal.moola@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1670531711; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=Ihy8jPmuCwZF2NUxckyF8mvKKJAfgGLMAeVZly3BYIQ=; b=UCmW1PLP+yHFTTBEUPTjM+8m8yai+L9mReEJOYHPKpWtk57c5k866vGV9G8hVeEt0JllIP uyscD8W+rtNh4X5yRmzSq26RsX5RMg9CmJrqv6S47d+TS04mCWWPEx+k/l8kobqlrCHLdx K74Xr5SFlEeQkFDP+IUeEnicV7Nt2/o= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Ii3vt0qJ; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf08.hostedemail.com: domain of vishal.moola@gmail.com designates 209.85.216.44 as permitted sender) smtp.mailfrom=vishal.moola@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1670531711; a=rsa-sha256; cv=none; b=Bvrx5K9SKXjky0lUDdk76GpqNXGICuWxL8VyQxLbnogWgV/CtmdFZo7aMF2HtjOoRzokV9 C6Vs5Gb0zaCbwdEd8CilqWIJa/bBH0Gl9eiArxJmvZFv0az8pJu4yJc2wDvdT5CFTGzNVr QYn4g+NXxriTK8Og71/QA7DbTvas94A= Received: by mail-pj1-f44.google.com with SMTP id v13-20020a17090a6b0d00b00219c3be9830so2728961pjj.4 for ; Thu, 08 Dec 2022 12:35:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Ihy8jPmuCwZF2NUxckyF8mvKKJAfgGLMAeVZly3BYIQ=; b=Ii3vt0qJdv0V25/feuGUMH7PzkflNrD7g8L2x6z6/EYO9gzRto4zD8ZTJENpqeU8XP gLmydlYQJhHXfGq9y5BeriBDQ11jeq2TYMS4ysPrNZ9lPX61JatrrzxhNPq8b43OY+1j ptjf++BriBBDjvyJBWStE5HuQ96Co+07MfQnvCs2OW/l8Fnd4dMK7S3wmVg9uQ10eoQe daaPLy51OxzLCvTwyZhN2Miw3T/m5LTvMPAIzD6bUUY+4EQQU/bJ69w/ZA8Q6XpK5xLy SxVqHOiUx+drkxy5pADNtrFlAQV+RXgMmv1emA5DGz0XXWcWdkZMZTar5/QzNUuvgqaX Bdxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Ihy8jPmuCwZF2NUxckyF8mvKKJAfgGLMAeVZly3BYIQ=; b=6w9tVGT3Q14rPr+qPQiufFzvpgWZ9GiPUFpIqSwLgg5z39YwIyHa7JExQIXJExnAwV 5gxLqTJTRsCi/9fH5TwOJXthKV9V4EjB2IdYx2H7815Py7GcGDXz7BLgCRM14VYIEnLP 4kT63KZnpFlEmtf8vShHncrqw9ZCoOJKAxf0InzPG5ah0BbpbM4HRAjdkW0ywfJBfRwI Lm0GuGXm/RVbIiGUbpNiS5Azt/BYTSDKS0XTt7Ifab4YWb45ZiJS/y98QOA85LFe+8bK VxaURwVsSVZIpE+unv0pNCn5mHm2+BUePn3OxsKjgH3jeSBEjVSHTWg6yHQJtsfBxkeS fXNw== X-Gm-Message-State: ANoB5pnwPqHJF2aaQyegImwB1ZWwjvsLdqb74jQx5kozCmq27BF+FvoK WyznXjpL60QEK82N5lsbcmMupx2XY+g= X-Google-Smtp-Source: AA0mqf4+5Zv1Qu99xU00p+xkeABzV897h+Xfstc+913jbdXvjz2pIi2b+ZYYSdFCNInv+po5xPqf2w== X-Received: by 2002:a17:902:e806:b0:185:4421:72e5 with SMTP id u6-20020a170902e80600b00185442172e5mr3989355plg.42.1670531709851; Thu, 08 Dec 2022 12:35:09 -0800 (PST) Received: from fedora.hsd1.ca.comcast.net ([2601:644:8002:1c20::2c6b]) by smtp.googlemail.com with ESMTPSA id f5-20020a170902860500b00189951514c4sm16954349plo.206.2022.12.08.12.35.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Dec 2022 12:35:09 -0800 (PST) From: "Vishal Moola (Oracle)" To: linux-mm@kvack.org Cc: damon@lists.linux.dev, linux-kernel@vger.kernel.org, akpm@linux-foundation.org, sj@kernel.org, "Vishal Moola (Oracle)" Subject: [PATCH v3 3/4] mm/damon: Convert damon_pa_mark_accessed_or_deactivate() to use folios Date: Thu, 8 Dec 2022 12:35:02 -0800 Message-Id: <20221208203503.20665-4-vishal.moola@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221208203503.20665-1-vishal.moola@gmail.com> References: <20221208203503.20665-1-vishal.moola@gmail.com> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 1CC8C160007 X-Stat-Signature: 6xuekrt6rxu7hineyiurydnp8kwyqsqh X-HE-Tag: 1670531710-367000 X-HE-Meta: U2FsdGVkX19UlkaSLgX7udvNp/9v5vTBDnZDN6gDB/4v1AIqqZtU17f11cbdgpduLKm2wiA9KNC9HbTgk+Q3gIYz1CMTBhjzIHf0G8h/JsAYUmGbum1ZS8nGrvhglChdzm8OAO8ex0S1G8dBG+Mv7n29AxYyHOkXmYWSGz9zbLg0lnv3RRF8vbdXYdvL4SmL8SXDbV/dJnUyKp5vGpipMj+gDH6SYg7GSI6CQr/n5TCNzPsmp0ZcyHt6Ri2QQDSO873+zjsBnv75EW9almT+Saey9gnOuMS5Yh3UJwdBw2ujCDY++UcyjrTmXomw7FgoIK69Y/l4YX7bvDvJ8yOd+NWy/vLp4YbJazP/c06nE6QRf9i8oQiXLvvOx8baPQY8zHsFir1kf80xfbc9zRSOGFtIkgv3soymXT0VHneKoi8m+IPIViET9UC/oio7O/Fw6RQzj04tsfpFhKhlSvQ+uKOZqIHNCeWYIM+5SHBB+Fgq/ixEpWQ+OSHl00agatcOe6UThAA2E+221FwjkDCxlPyAdCt4fogg5MK62HVReiVq1b+7KkMfnTm/dt6btyv5yf4b8zidTfHWBEt2QQvGKwTneRU8/dHSy7Yz5R51AJs8bBPHk5UnydJHq8WeV4sENspqf+1P6MydyTIiKzbw06wjZRaRA3LgaTTppc2PL/9dZKL3eld0ORmklYK8wMXUpZ4UpMOkoRYz/UgoVTjoFEVZnyG4E7w4J8ZOa2rtwtduILSmVjhAuUipo+1NatzOmb5ZKJwsP3gfidGHKgLsDAVzRBMbXS0reeW2CM4wZ5eIDtNh0yPnLF7KGjcvtMhB4J4ZDw0E/DZPGPzn8pdG3a3dvUCcs0B1jK9vjeEVGVMHFjeUyp6BGR/m1Sa275PyzEBhGxsriuDNp6WVMeCDQCw82crP+lAvncx3LxWMJYNlPHYDtIqtQCLnRDYAmN4aWYd/lmcX4e0Y3r0KRRj vyp2RRzB Hoam/myVSJ2tBaRxQcW+VXRSbvQesu30EN+0gcciNwD4AWaCW5aMymxE8ojcEsTJ0TpSFTeNTrZC+3tJDazGbekLRFq/7PCxfhvqy41z440fCszP4Arg5Qfp4EJ85vgxxiRhsDmA/ZQtrTTZ5qvcGBdn5wBfbPfHkUoVUFJmYtzyQfhuRLMSqjvCd4FSed+CEYub7f2zhLu4kvPgCsOjpJQmQlZriuoVAEp98RbilUhGPuelCt6XU6oReaflkV+dOxZnNKhw8QSqxEP/WGPBTKeRs3w== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000011, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: This change replaces 2 calls to compound_head() with one. This is in preparation for the conversion of deactivate_page() to folio_deactivate(). Signed-off-by: Vishal Moola (Oracle) Reviewed-by: Matthew Wilcox (Oracle) Reviewed-by: SeongJae Park --- mm/damon/paddr.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/mm/damon/paddr.c b/mm/damon/paddr.c index e1a4315c4be6..73548bc82297 100644 --- a/mm/damon/paddr.c +++ b/mm/damon/paddr.c @@ -238,15 +238,18 @@ static inline unsigned long damon_pa_mark_accessed_or_deactivate( for (addr = r->ar.start; addr < r->ar.end; addr += PAGE_SIZE) { struct page *page = damon_get_page(PHYS_PFN(addr)); + struct folio *folio; if (!page) continue; + folio = page_folio(page); + if (mark_accessed) - mark_page_accessed(page); + folio_mark_accessed(folio); else - deactivate_page(page); - put_page(page); - applied++; + deactivate_page(&folio->page); + folio_put(folio); + applied += folio_nr_pages(folio); } return applied * PAGE_SIZE; }