From patchwork Thu Jul 11 22:04:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suren Baghdasaryan X-Patchwork-Id: 13731117 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 4A3B4C3DA45 for ; Thu, 11 Jul 2024 22:05:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A25156B008A; Thu, 11 Jul 2024 18:05:06 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9D5426B0098; Thu, 11 Jul 2024 18:05:06 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 828236B0099; Thu, 11 Jul 2024 18:05:06 -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 638206B008A for ; Thu, 11 Jul 2024 18:05:06 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id C42BAA0872 for ; Thu, 11 Jul 2024 22:05:05 +0000 (UTC) X-FDA: 82328852970.17.FAC929A Received: from mail-yb1-f202.google.com (mail-yb1-f202.google.com [209.85.219.202]) by imf12.hostedemail.com (Postfix) with ESMTP id F004F40008 for ; Thu, 11 Jul 2024 22:05:03 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=fAJXsHSt; spf=pass (imf12.hostedemail.com: domain of 3DleQZgYKCDknpmZiWbjjbgZ.Xjhgdips-hhfqVXf.jmb@flex--surenb.bounces.google.com designates 209.85.219.202 as permitted sender) smtp.mailfrom=3DleQZgYKCDknpmZiWbjjbgZ.Xjhgdips-hhfqVXf.jmb@flex--surenb.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1720735488; 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-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=93kJQnyc8fg8K6y0X8F3xN7SC1oO5b0Dd7FB+lYPuNQ=; b=YW/MSHTzH8g135S43cbFCINkbr0Tv7XljSSd0CKdhs52D+aSBkT3DlNMCpvg43bsbjoMSa 2DZrxakR3zOFfOYL0QXi6DpeuPZabwgtRTcHvANnyUtaK7w2J86NshWJoPnuqOwJxJ3RKi zkmK3Gj0tEacaKrJedRI7EdNyLxlsdc= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=fAJXsHSt; spf=pass (imf12.hostedemail.com: domain of 3DleQZgYKCDknpmZiWbjjbgZ.Xjhgdips-hhfqVXf.jmb@flex--surenb.bounces.google.com designates 209.85.219.202 as permitted sender) smtp.mailfrom=3DleQZgYKCDknpmZiWbjjbgZ.Xjhgdips-hhfqVXf.jmb@flex--surenb.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1720735488; a=rsa-sha256; cv=none; b=jVURoB0fAC/5JO90JxBaAdYhb3YlQLWBudmUvCccTd1yVzHbCd+eMSlk6PMOuXM9zMjvmR 7/ofZLHBTllOGKolFj3Qm6ykDJzISsRzU6vYj+yELiLlN1QUCrC7JV/lIcStBfvR6AisAh Gsk2qmaHPZMbrBT0lbpAIYGtILn4Jro= Received: by mail-yb1-f202.google.com with SMTP id 3f1490d57ef6-e03a544b9c8so2180761276.2 for ; Thu, 11 Jul 2024 15:05:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1720735503; x=1721340303; darn=kvack.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=93kJQnyc8fg8K6y0X8F3xN7SC1oO5b0Dd7FB+lYPuNQ=; b=fAJXsHStABBeWxaQenPFSc8jqsknv4OdQR+F0xfOD3yvr/aD18rnhxwcLdFJArzFS2 uYjDUoEWoY3wveOglMw1L5nv8hUdKiG0PZfi/W0C/Tjhdx7Krw7eeGLyM/6+5r2DeqEF SE2rzd+KdX0/OyGXKAw/KZ6XbmJe18Yv0/rgz8FeE6L3NjRxMI+3MDcVTq7mEYKle9/V xSGcyvErwoKe4laTO2qh85w0VkFVgwJ4n3Jq6hA7vwxysZNtnSYZMd34oOeWRq+i+0hp SED6X0jgb6e/Xi+3hIDpaeeD09KeRlWGOxq51mKUEzARy7dJaOVVN3jv2sZqpdb0k+r7 LU5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720735503; x=1721340303; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=93kJQnyc8fg8K6y0X8F3xN7SC1oO5b0Dd7FB+lYPuNQ=; b=fAAeNuYqK9UY+Wzugf1pdgHXVEH06O74uUZAjufMWf0I6EX/CmexWAlGvs70+54q+o +wfXKo3hTZKrMJHIg/0p7e31Dsh4U2ld6IMj0JQSNuM1QAbPDFtfghSG8hyBHa7q6YKy 3M83YVgvgNf8BP0Tw4aCMCj41NlwmODYbYSY1ncnhlz9gFwLGmABUrAuy0T27kn61jIu 2f9SKwN+wVJ4I+/Y4kwRkiAv7SO3P1FRaLpMCBr4lXG6ACZJGD1e1rcEh6zCaxi+Er5k CU95NqVgrnNbRFtR/nI1FjjfQ9WefpTnXQsC5ZT8ekMmFpcbhNGIaGuOpxGAjEr1dOLq qJag== X-Forwarded-Encrypted: i=1; AJvYcCUoL+T64VllDgvMapazkrGyUyNCqNCI4iXHXQcgJb4E1ahiRjc6IhOxgB8BPd08mxTowBjSbIUV47BQ73SY4HgUfmI= X-Gm-Message-State: AOJu0Yw+8pw8+x1j/DOFL6Sj549M60byykiK5XRN6GDO6RWnGOBZTCL2 3WMukH6zV+Nu5EPwxdcFHn2YRa4u8Z8THRzUUnuAA96c0bHMZ8zU+vChhaYwqUCb+WWK3bCItjV mAw== X-Google-Smtp-Source: AGHT+IE5Ve5SJ1wAwBQCkjGpJ5hWlIgqCRMJq8/YBUF401ZfiUTIDMS3IJ0Xh5DM4xHnHKnJdlSUE6tovAs= X-Received: from surenb-desktop.mtv.corp.google.com ([2620:15c:211:201:3f97:69c0:dd80:bd4a]) (user=surenb job=sendgmr) by 2002:a05:6902:1208:b0:dfa:48f9:186a with SMTP id 3f1490d57ef6-e041b0370bbmr22072276.3.1720735502941; Thu, 11 Jul 2024 15:05:02 -0700 (PDT) Date: Thu, 11 Jul 2024 15:04:56 -0700 In-Reply-To: <20240711220457.1751071-1-surenb@google.com> Mime-Version: 1.0 References: <20240711220457.1751071-1-surenb@google.com> X-Mailer: git-send-email 2.45.2.993.g49e7a77208-goog Message-ID: <20240711220457.1751071-2-surenb@google.com> Subject: [PATCH 2/3] lib: reuse page_ext_data() to obtain codetag_ref From: Suren Baghdasaryan To: akpm@linux-foundation.org Cc: kent.overstreet@linux.dev, vbabka@suse.cz, pasha.tatashin@soleen.com, souravpanda@google.com, keescook@chromium.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, surenb@google.com X-Rspam-User: X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: F004F40008 X-Stat-Signature: qmp5md4s45cm5do4kzwskkkqhdbpdk8f X-HE-Tag: 1720735503-796150 X-HE-Meta: U2FsdGVkX1+igczV0OYfXVlDHTuz7OCHiouHYOs8Z4XLfz+rfuAJ+85WKPDcp18cWh+UOb6xKztredw3h3RCRnx3CBNDCqMK3NAOn1olOVgLfJoJx6ReXbiBKXEUkdv//PPdg+wsXfF/eFeGkj2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RGxpBlMNuH0Aj+U+fRkgky/IevMNYVo0KhgTBJ/cBzQTQZGo/evb5M2bYMZMca+8yfowzO7OsmfWzlNhWJ+OnGGcsnggG53fAS41NX2Y1s6k9oDfvQxBU5+4ifqO1+I9crdmMUw9/CTog3an9WdCItQiSSb7wtbERLu9U5AyWemnNa07VymY263sza2kEiXHDiIsVaxLlNokO8xBxwgVS3EhnLbfkXCS1drH2aNAqU8SBnPi5x7hMWFGrCMzFSy7WOw2uF7PJ2EujzSnljxlkIPGNRipwieewOvf2CrJ798l9h075UB02wZCAV+iWso1Y1pnHlS8SD5Kw== X-Bogosity: Ham, tests=bogofilter, spamicity=0.060971, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: codetag_ref_from_page_ext() reimplements the same calculation as page_ext_data(). Reuse existing function instead. Fixes: dcfe378c81f7 ("lib: introduce support for page allocation tagging") Signed-off-by: Suren Baghdasaryan --- include/linux/pgalloc_tag.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/pgalloc_tag.h b/include/linux/pgalloc_tag.h index 9cacadbd61f8..acb1e9ce7981 100644 --- a/include/linux/pgalloc_tag.h +++ b/include/linux/pgalloc_tag.h @@ -15,7 +15,7 @@ extern struct page_ext_operations page_alloc_tagging_ops; static inline union codetag_ref *codetag_ref_from_page_ext(struct page_ext *page_ext) { - return (void *)page_ext + page_alloc_tagging_ops.offset; + return (union codetag_ref *)page_ext_data(page_ext, &page_alloc_tagging_ops); } static inline struct page_ext *page_ext_from_codetag_ref(union codetag_ref *ref)