Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1611922rwb; Thu, 8 Dec 2022 12:58:19 -0800 (PST) X-Google-Smtp-Source: AA0mqf7Lw4ongNxhIpBUCL7aYlWJCAg533UIy6u5G1i86BkIOeUMTUuaV0/CMwxoyRasXH1EV6Jw X-Received: by 2002:a17:906:94c8:b0:7c0:a321:8df2 with SMTP id d8-20020a17090694c800b007c0a3218df2mr28847768ejy.308.1670533098893; Thu, 08 Dec 2022 12:58:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670533098; cv=none; d=google.com; s=arc-20160816; b=iWvEZuJf1fKSCUlEzJxOAYFGP+twidPcC4Rsw5IRNibTCwuPn0bo7C8FEAht1SIevb dR8GpzF176knqHDl1+8vv5FKCp4ZySdA3oSySVNv+7fPMGw5ktC+juFnxVM880Bfiyg9 /FK7xXay1c4CZl8fh0PJMf0EAteAJbZ9YH2o4LP89S0ZxukpFPYnDTku3yKUdECx8/D0 ns0b6gdxcmYskt9yTsA9b6fIHo5hf3J6ofubImxoBuzxq3JUb3a9/pmw1xXx3B1pT9GA qrVG5TWi4CubHMGFom1g8cc88qc+GdFY+c3BZSMyeZiwNUfJERvor315G1QZX56ENIzl I6JA== 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=Ihy8jPmuCwZF2NUxckyF8mvKKJAfgGLMAeVZly3BYIQ=; b=kOs4lqjPycYVl7MU6PcV9otlI/4+kDdJZuq9SW1z6SNBvLuwgsG9ODQFFaxPlfo3lS e0dXvnvqdOljtU8G+PWDNeyo1AwNrHwQWVcWDCnD9X0rqeXpNT9j/JI2O5jhYdRHbwJJ +66mU8Fp/+etjx41YoYxpCkkn/nNA3QhULEahlvvfRB4DXI8Bp8tflWZ//Jfy7cSDKwr 3766e2gsyZ4SBT91skq/ROHviwcHa2rr0zuKHVhQIGVu2MXU4OBxFKUZ1DV32iMNM1W+ YTfE/lJ8ZcjiggfOSsrEMDsptbd4yVLP/41vjfF6dPqefMalSwxq1eaeGjbbW56GsMhn 27Cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Ii3vt0qJ; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id oz14-20020a1709077d8e00b007adb6459e64si20372273ejc.862.2022.12.08.12.58.01; Thu, 08 Dec 2022 12:58:18 -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; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Ii3vt0qJ; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229500AbiLHUfW (ORCPT + 73 others); Thu, 8 Dec 2022 15:35:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37476 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230011AbiLHUfK (ORCPT ); Thu, 8 Dec 2022 15:35:10 -0500 Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5A6AF862C4 for ; Thu, 8 Dec 2022 12:35:10 -0800 (PST) Received: by mail-pj1-x102f.google.com with SMTP id k88-20020a17090a4ce100b00219d0b857bcso2751742pjh.1 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=wW6aerC7mH30USWPjCeg/CdCbWsf9B3EUmf32Z6o5J7knUo0KD7g7DwQDv4afteo+H sq53hCZmyitRvd9FWf9gYx9nCqFKF8kZlydZV1l4VaDbB2juybMBWUWpCyd+x+yV2uPn eHvg6zMhAX3NrALaGHXOOaYlUJpMq1cFlJ2Bd95+AhGsPTN27Jk7bEeuttGMVE4oooFp h6a5wMnsvb0/m6Xz+5HBThipgxlQttrIsoN4tyyBkoFJO+VhzZfrQgzNiACjePTZXF3f 22A+9tB9nQ21xXYIXaR3JU5ByvULmy159IQ25Pp5SsAONIbbS/QgxbpD2gsaW6jpDAAn JGGw== X-Gm-Message-State: ANoB5pnCBklSmuf1yRoQjttX44SIPAyWt/08FZZexCWKkkUsECWiLQoc p5tFbwn6zNQs1bQpsrM1ZsdIybEpC8w= 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 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,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: X-Mailing-List: linux-kernel@vger.kernel.org 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) --- 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; } -- 2.38.1