Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2070002rwd; Tue, 13 Jun 2023 19:41:46 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5IQhf5pYr3TD+GO5THl0W/prsFGd1wSY2VvBepbElXXeQygQJBj/6ZN+LGCrFlGYNc3zFJ X-Received: by 2002:a17:902:dac4:b0:1a9:6a10:70e9 with SMTP id q4-20020a170902dac400b001a96a1070e9mr369733plx.33.1686710506569; Tue, 13 Jun 2023 19:41:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686710506; cv=none; d=google.com; s=arc-20160816; b=EgBakdmuGXXu2zAW5d3M1F80lGUh1ECllqilsJ9Mcki0nUlWHIhOoynwv1V5FZ3uX/ j4/XjOqy13/aGlYnzco3Y94Vp55R1ymTWzKoT+tifcL/7EybLV1b3cymYJ6lnzRMcSrV Y2tM+//Z73+/3GLDma1oV3vArSl7988fy2GLO26kSDXKHqGk7nHlVzyGGVgmGMY6XoCW ga5kfbqSTql0mZ1fDy0UU8xo13kJ5T0noQ53uBf4mKtvxjfxY6Q4+A7hZEaOZ6iyzHrb o9w8Bn7b6QV1hQBJtXtqTaCVSboX7zxPlxv0EjMEslEhnU2p8zMiLhWj9IID+rsvJ+E2 RI+w== 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=gm8RCzO5kq5zZdBwoalxKcPrbyd/4JyQrIpAj2PmnKw=; b=SRcgZiWaOFXDrquzQKOM5c83TW5pFRg6g1/l+UuQlEyVqlscCcHfbKzCKs2QozrKiv CnQ1Ksyvmjct2O7jaNZvs9zlpntFHZ0BAip9g9pqOlvpEoH5EYPl4QDh9jEedkwXsVKM IuJT8ZMNCDEbXU+RwMfBF15787ktjygYrpka92EDYB8jAs9C2JBGZZ5jPC4/AKl+V80c pnTvPPyGCVe/zlEvOnMcbic7tTqUuLZUxu+xIbBRgYaSABs4jP/xpt4lQh0QwDEjaxoT FZQManh9WY0HyUKwQBkVmO4k1k/08DQhCLb1kQYttXFYPWjA75x20jGjb0sP4LBV/LKv VEgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=JF+8NNIB; 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 e7-20020a17090301c700b001b1cdef2654si6401028plh.645.2023.06.13.19.41.33; Tue, 13 Jun 2023 19:41:46 -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=JF+8NNIB; 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 S242164AbjFNCOb (ORCPT + 99 others); Tue, 13 Jun 2023 22:14:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56920 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242140AbjFNCO1 (ORCPT ); Tue, 13 Jun 2023 22:14:27 -0400 Received: from mail-yw1-x1134.google.com (mail-yw1-x1134.google.com [IPv6:2607:f8b0:4864:20::1134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A9B0119B6 for ; Tue, 13 Jun 2023 19:14:26 -0700 (PDT) Received: by mail-yw1-x1134.google.com with SMTP id 00721157ae682-56ce96063bcso2569007b3.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=V+vwJGC7MV2TZwUpAZ/zMt5UudMjQ7W78QsLYE8/E9po4Gezn82XFNfN5SIihEeKYL +cVEQHx+SY8ZpdoxXBajTfHnG0mA0qsVrNK359R+/XT8lYPWEGB9ZG46maFuOEf2MHpN ch76at0Hy+A5qMUGOawUrVo5pwtzyFPzmlJ4g9qCyPF7yS8dG/M22vsuVD+8vHzwFkmS 1qBSLwP/vCLklQrkRFwTCWVf1aaWsS/vjl2BrC2M5EliEgDYr3bZl2q87rUiH7Eooa+u FEgXVqR2+6+GX6h27eqrRAC4tEaF6FuuHZAW2ksJtBq0zbp839d9iKpeU/a6/ZIkgiUn WbXw== X-Gm-Message-State: AC+VfDyBtLx25SFAHcJEN5Sj3eV8WNBUX5GK+ys5VGTSkMMvtBSnqrpO 2sa6zSHRb1R4tWaDlW0uryf9jM6ECIY= 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 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,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 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; -- 2.40.1