From patchwork Tue Jun 13 20:18:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vishal Moola X-Patchwork-Id: 107532 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp806975vqr; Tue, 13 Jun 2023 13:30:55 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7Q0oSh8UATU7VASD4ZazANSAaQRGu3UNhY2dXwZQlzd3+xJN+O68kSNZks8nrwchbV3gSz X-Received: by 2002:a17:902:a983:b0:1b3:e6ba:1575 with SMTP id bh3-20020a170902a98300b001b3e6ba1575mr2727028plb.16.1686688254846; Tue, 13 Jun 2023 13:30:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686688254; cv=none; d=google.com; s=arc-20160816; b=RNwIQWeFMQ2usscyLzisQTZVd2+u4oQEqOiI///IIaLCYfUMsl8wWs2mvrpHmn90FU noXCLYYXLD/p7Uk+lOdJQZodBycYc1Fp3Np6GSScb8r2NoY+jX8xVVbLqCBnAGGN0Afd q5m8MTLNd2yxOF0A2SZm6oGBg7Cgtylth/RiMkZGb4Gytge6avBCA3yw/aUCaDygaILb UxwscAvGt4SE3HX1590sbxlvDKdWlJEJ61zvOEyJxTsgk4ryWQCYBVKc7EXVLCPb2oOj iSbVaNC8ScZH1OSttLizdwcTK6wrg2M092CebZIJ4cwu9qT7pHvTBUCAdTTwmx6nBIFA pEng== 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=U6KHUky1DpkusNGgmBNXNnpcQ1dWjAR0pkWJnKeXby4=; b=olI/b/wne8x7ShY26EV4WaQBRw8OZnmiqtAT6NzIbievvUCAEuDTqzKtPQJVeg17E5 vk9aB0LVUuZY3CdZkRVFx7cr6spyuPiGW+lO/esIeTZUHFuEZcqKNdBy0F7/oNA8Uwh4 BVFynbTVDG8lZXCt39+C9J7GUtThJXOt940s3T/XY9PilRnh+5r0VwWJCRwxLjbp/qwL DWAPb/r3ZTFvmdBE2w5gF620nbIUFS1MwE7juWnN6UjD1YHm6INAeBHbFK7TkSSLcvbE Ja4fXm1zDb/JEga6vZ071bPXfnyAw3oXm3YzZoOr2hZiZrWLWXSJKzbTKLb6l2gmPDGw hZuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=K51pHP9w; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kz6-20020a170902f9c600b001aaf8182cc7si4734873plb.425.2023.06.13.13.30.38; Tue, 13 Jun 2023 13:30:54 -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=@gmail.com header.s=20221208 header.b=K51pHP9w; 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 S240920AbjFMUTO (ORCPT + 99 others); Tue, 13 Jun 2023 16:19:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241050AbjFMUSz (ORCPT ); Tue, 13 Jun 2023 16:18:55 -0400 Received: from mail-ot1-x332.google.com (mail-ot1-x332.google.com [IPv6:2607:f8b0:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D720E1BEA for ; Tue, 13 Jun 2023 13:18:34 -0700 (PDT) Received: by mail-ot1-x332.google.com with SMTP id 46e09a7af769-6b291d55f52so3333885a34.2 for ; Tue, 13 Jun 2023 13:18:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686687514; x=1689279514; 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=U6KHUky1DpkusNGgmBNXNnpcQ1dWjAR0pkWJnKeXby4=; b=K51pHP9wViB3ZadMEXzWsfIDKin1lsEdjUYjh4DAwZ9sRHvdPjCCPf9ICl06aw5cUM QCRpWcyMMeWIyke9qqZO0B0qjy/mN6tyRAheWiPYKE6boBZfSeHb/3glWNTAVPHzvltu anwJ3GiEbzQXjjlDk2g9eGm7zSJB9xg+Ehl/JjSyVxyt9Y93aNsoDxx7HWS9aKOTwE0s 7XtO9aZwf6Lem17hnmOg8y48qHKRxU5qXgoihMMzOSYzowYHUNkGTr0uuTOGdw4cTmks K7jkvCu8YCPUkTvNSDe4dX/b+Fbp7pNGPckvp3MXIBC/7nzzhr6wE2Hs9UBoSHWI0pon 8/6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686687514; x=1689279514; 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=U6KHUky1DpkusNGgmBNXNnpcQ1dWjAR0pkWJnKeXby4=; b=ka4FxCPqVpY5UaDo0frxHIBIjBNBiTh9IUzbfP/Es22Z+bIXlyx8oZqvUHYzxdWPi/ pDoL+ppMabHBXi8eVzgf2squlKZE2GylXPg3b+/bDxQ+89W0S+KmF2p+q7QQhT/IJuwz yiS/rIgFXPI+gLoSPTGjYRfzEI15ynjEMwk7vtPBoLPkqM1gkuIi/tam0XU9rxSnNhpZ iVmZH2FlsRJz2FhZ6RRBraxwyinZGVRWSZeyj856HDIR5YBoW7nAnCHTwpSa1vS8Ox8X T04Me5Ic0al5UzY1cEDhY7xDU7n1U4SHxij3ITQkui5lAfX4Lc5JskCeWp/0rhsJ9MT1 YfEw== X-Gm-Message-State: AC+VfDw4VS1qCBNn2rFbzmMS9QgX8iBtbgUUZxBEPT4FLX5uL+woUADr bmI7D1fhPFJaETRucknKocs= X-Received: by 2002:a05:6358:e813:b0:12b:dce7:f428 with SMTP id gi19-20020a056358e81300b0012bdce7f428mr5201292rwb.1.1686687513897; Tue, 13 Jun 2023 13:18:33 -0700 (PDT) Received: from unknowna0e70b2ca394.attlocal.net ([2600:1700:2f7d:1800::e]) by smtp.googlemail.com with ESMTPSA id b72-20020a0dd94b000000b0056cea0480c6sm2509985ywe.2.2023.06.13.13.18.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jun 2023 13:18:33 -0700 (PDT) From: "Vishal Moola (Oracle)" To: akpm@linux-foundation.org Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, "Vishal Moola (Oracle)" Subject: [PATCH 2/5] mmzone: Introduce folio_migratetype() Date: Tue, 13 Jun 2023 13:18:24 -0700 Message-Id: <20230613201827.9441-3-vishal.moola@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230613201827.9441-1-vishal.moola@gmail.com> References: <20230613201827.9441-1-vishal.moola@gmail.com> MIME-Version: 1.0 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,T_SCC_BODY_TEXT_LINE 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?1768620823648934570?= X-GMAIL-MSGID: =?utf-8?q?1768620823648934570?= Introduce folio_migratetype() as a folio equivalent for get_pageblock_migratetype(). This function intends to return the migratetype the folio is located in, hence the name choice. Signed-off-by: Vishal Moola (Oracle) Reviewed-by: Matthew Wilcox (Oracle) --- include/linux/mmzone.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 744bf32e48a8..b58c76e68ac7 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -105,6 +105,9 @@ extern int page_group_by_mobility_disabled; #define get_pageblock_migratetype(page) \ get_pfnblock_flags_mask(page, page_to_pfn(page), MIGRATETYPE_MASK) +#define folio_migratetype(folio) \ + get_pfnblock_flags_mask(&folio->page, folio_pfn(folio), \ + MIGRATETYPE_MASK) struct free_area { struct list_head free_list[MIGRATE_TYPES]; unsigned long nr_free;