From patchwork Wed Jun 14 02:13:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vishal Moola X-Patchwork-Id: 13279459 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 60227EB64D7 for ; Wed, 14 Jun 2023 02:14:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B04738E0003; Tue, 13 Jun 2023 22:14:28 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A3EBF8E0002; Tue, 13 Jun 2023 22:14:28 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8692F8E0003; Tue, 13 Jun 2023 22:14:28 -0400 (EDT) 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 70B458E0002 for ; Tue, 13 Jun 2023 22:14:28 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 32910A069F for ; Wed, 14 Jun 2023 02:14:28 +0000 (UTC) X-FDA: 80899734216.14.59B424B Received: from mail-yw1-f174.google.com (mail-yw1-f174.google.com [209.85.128.174]) by imf24.hostedemail.com (Postfix) with ESMTP id 65A31180006 for ; Wed, 14 Jun 2023 02:14:26 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=JF+8NNIB; spf=pass (imf24.hostedemail.com: domain of vishal.moola@gmail.com designates 209.85.128.174 as permitted sender) smtp.mailfrom=vishal.moola@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1686708866; 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=gm8RCzO5kq5zZdBwoalxKcPrbyd/4JyQrIpAj2PmnKw=; b=OfbPwMVOHTO6KPQ7sR2vMCDsBlyCCkrsJebifmJsSHOxDcizZYonxqqGusGlGQUBOTPyJc TW00fG/mXIMlYjqV/Q9nnIDfqz3AR1LbXnjsZM0Fps4w1yItHHdfFa8fAaZowrw5YYUele HUyHn64gdb3UWo+EtD953WcWsANFNF8= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1686708866; a=rsa-sha256; cv=none; b=HLJPixi+VjELYgoxZZlr3xx32cSHSnJTWIC6zD0h0DtozmwCYeB2c3PP1Bo9ZBXI1jdN+Q LuCGb2jhEoIncHeyU1CBRHJwqUU+lqbDfs208OoMUVtIKAGb0012DxpOOe4lEOmXJ09FlS Mn5JYuSPpyALevfP+bGgXTbTHT7xjcY= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=JF+8NNIB; spf=pass (imf24.hostedemail.com: domain of vishal.moola@gmail.com designates 209.85.128.174 as permitted sender) smtp.mailfrom=vishal.moola@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-yw1-f174.google.com with SMTP id 00721157ae682-56ce96063bcso2568997b3.1 for ; Tue, 13 Jun 2023 19:14:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686708865; x=1689300865; 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=gm8RCzO5kq5zZdBwoalxKcPrbyd/4JyQrIpAj2PmnKw=; b=JF+8NNIBzGX1b2qFl1Jx5pRAVPswMcC79XRisd5GVibmPivKhdXQEHc8d7/naDK+Up gOMZkzClZyEGSeqowDIclhILZeAtC2CVfFdBwWcF72qAW2JTytgWt2OQV3y8I8RctUcx rD6KgJEg8oUdHwdiguEbWPj746c0VQZU0McaRD4kt+DEq6GIX/MNy1JMHSsOA3yFYFsC sHAg4yl8apB5t961Pr7CxwWzQlGHdj90B056A9+csCHCbRFN/NaFi5TKCTMArvGdCO+F b6N2BalFlcr/9l9jpyRKLKuba5H+KeeEYg2dX7MvukOZKS8aw4C9SYq3KCCoGkWnNaHm 3bTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686708865; x=1689300865; 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=gm8RCzO5kq5zZdBwoalxKcPrbyd/4JyQrIpAj2PmnKw=; b=LJoFpseVL2A/JeXbijBJv8HvvjHW2W1E0trXmXIwCfHUOAud5Vo6XHczxmK/2cbG8e REBf7tnSpqwAJvPP14pUDejmcIp29Uw3hZmda2Bnxhn5A8o8aTb/haUQfgX9UuNatyoo 8o5HnnEbu2b0HE5s2bOLqDgWTiHIOdK+r0tbYjIZM+rMeel22DxkK6jekk4cDOH9Xtz/ q4v4Rtd3ouGanEcWACJpZ3heWsm0crA/VyljsUYr5IG7n/iVyOfodqEhPMeTmsDeBfUV 3K1gFgl/1W4IdhuAyw+3vHC8qX3caIh3naSWnZfVkmbTWj/em5zT3li0TlNnLVKcQDoW UN+A== X-Gm-Message-State: AC+VfDzOVe086rn0X92OXxR4d+Twvg6wUyXY0ckzVQWDGkJFz3WvkTKr bRsjzwyDKHZb2N0ZrQNGLGs= X-Google-Smtp-Source: ACHHUZ6/DNbpBrJKVXMNBdlaoO0AvEwN+Ng+T489V7u9cl6KqrcMtLNf5K/XiLAGr+3x3Kr65Pz04g== X-Received: by 2002:a0d:e6d0:0:b0:561:b53d:d1f1 with SMTP id p199-20020a0de6d0000000b00561b53dd1f1mr160456ywe.19.1686708865329; Tue, 13 Jun 2023 19:14:25 -0700 (PDT) Received: from unknowna0e70b2ca394.attlocal.net ([2600:1700:2f7d:1800::e]) by smtp.googlemail.com with ESMTPSA id p3-20020a817403000000b0056d30f1b508sm1463931ywc.107.2023.06.13.19.14.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jun 2023 19:14:25 -0700 (PDT) From: "Vishal Moola (Oracle)" To: akpm@linux-foundation.org Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, "Vishal Moola (Oracle)" , Matthew Wilcox Subject: [PATCH v2 2/5] mmzone: Introduce folio_migratetype() Date: Tue, 13 Jun 2023 19:13:09 -0700 Message-Id: <20230614021312.34085-3-vishal.moola@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230614021312.34085-1-vishal.moola@gmail.com> References: <20230614021312.34085-1-vishal.moola@gmail.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: 65A31180006 X-Rspam-User: X-Stat-Signature: 751h4iku5wow747tqd7ii8txq3bqfzt5 X-Rspamd-Server: rspam03 X-HE-Tag: 1686708866-231361 X-HE-Meta: U2FsdGVkX1+o5mUpm8V6nCD2aaBynUDPK8OaxkcKHWIS2MrDotH7/+cY793hXvmXE3Xwq6EIU8nwfMJq6En0b4cUqFvuDPcidRSkN9rr0Om6GbTXxATDnBlJw41iW6cAx7YJKI4kkNdNJNGhc913APDBPEZgOEPoBoVK2WARN4tDDZiWhFB9y5SsCttx3W91ef8x/Eth6rXexdzWsNVIp5JMja+GhE5paSvj4NrUQOx9Wswd3MSuGZekDJyJGxz5ahg/lkLcjxsqDTJBSArwwBPd5idPUCUOVdnoyrxKdPSjzQ8jcDzy4u6br9YT2+5MzVQqz2oR/9po1yXOUW2xAg7KLL/iKxs2RpicHHeFNB+PMPFfnkDZE5fFF+e2cwDkKGeNFmjY4cx+gSBwQjT5tb4XYDoXB1S66joTNpj27hrdi0ncR5edgW9uFh0gxePecNj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9ahx20WyPyxreo+ZmBu8w1qmeWmHKRw0c6ZyAKrq/8W38XSM4yRSUjERCkq70r5DIXmwOcFymt/m+IRnS3qhMn0d7Uz3gATemIQC9OTj/7 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: 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;