From patchwork Mon Jan 13 13:16:06 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 13937326 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 235C0C02180 for ; Mon, 13 Jan 2025 13:16:43 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B4BC26B0089; Mon, 13 Jan 2025 08:16:42 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id AFBA66B008A; Mon, 13 Jan 2025 08:16:42 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 975A96B008C; Mon, 13 Jan 2025 08:16:42 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 757766B0089 for ; Mon, 13 Jan 2025 08:16:42 -0500 (EST) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 317B71C6D7E for ; Mon, 13 Jan 2025 13:16:42 +0000 (UTC) X-FDA: 83002478244.04.7B70C69 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf19.hostedemail.com (Postfix) with ESMTP id BA8251A0004 for ; Mon, 13 Jan 2025 13:16:39 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=M+nlahQl; spf=pass (imf19.hostedemail.com: domain of dhildenb@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=dhildenb@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1736774199; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=yqxlMuEwJ96RDEbbwPDjzSu+ESMvaexzxAdOoodpgX0=; b=nSri/iqBXYxJTXDCx53dXEthNWpAq/Bt+l5RVYT7kv/OZqpSyHLVW4spTUto6MPHFkmyEC 72QbpkNxREYDHCeTzHBv6FTBdJwQm2qprVhdeN/OktOoikHcGtAFhhOk4YYKajktpZXRcs CEY3PeXxQVbePz46v8CS2Z0iF9MxCXA= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1736774199; a=rsa-sha256; cv=none; b=7+wjKj8rg6hwvvlvgVYOaGyyM8H10FbaFwZrgnfgCPu0JDn6CEEjFvbdZD/mcUUy5bgwmK TuNlrFgJI4KwkGBivyDA0mmByAsCxv/LV93ZnvCb5CJ9qJgm+aakq0G+e/sFQz2h5Z0fmw zo4yxt21q7tdZrKHS8zeoQ1q1YcEGAw= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=M+nlahQl; spf=pass (imf19.hostedemail.com: domain of dhildenb@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=dhildenb@redhat.com; dmarc=pass (policy=none) header.from=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1736774199; h=from:from: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yqxlMuEwJ96RDEbbwPDjzSu+ESMvaexzxAdOoodpgX0=; b=M+nlahQlikF0D9V9H/xvnFiBNFM1qmFqlh++j1+yHALW8V/96oBF+3P2r1kHPSgonqEFlW PDwhhK7L8QFK9XanjNTuM5M+UufauvevUCHnpy9wRB3VaUFZ+KSt3oG2EGVV1YUouxjmn4 93k99qFgdoaO41yAiRUyDGoBVBCZVCk= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-571-TV_ijYTWNB2vmpGfuJPKrg-1; Mon, 13 Jan 2025 08:16:36 -0500 X-MC-Unique: TV_ijYTWNB2vmpGfuJPKrg-1 X-Mimecast-MFC-AGG-ID: TV_ijYTWNB2vmpGfuJPKrg Received: by mail-wr1-f69.google.com with SMTP id ffacd0b85a97d-38634103b0dso2599062f8f.2 for ; Mon, 13 Jan 2025 05:16:36 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736774195; x=1737378995; 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=yqxlMuEwJ96RDEbbwPDjzSu+ESMvaexzxAdOoodpgX0=; b=hEuEehefj97ZLod5i1/xxwneE8PRu6HGqhOn03DKmLS7ropPWNAcWfwQho2cVxwXwq 6QVv4ESNMeX/Q4BmmmpE/h6Vb0yM4PU3GYB1bnHEMg/kQI+PM6dORVsnOItkFUOmEGnF 60GaRuPNTo8PCFr7SBWNV7J6+ofbTby530o/hutAK/W4kkZAz7Rn7Y+aWFHEnkYhKH2l GhtApckdQmn98yhd6vy06ky7S+chhTy5UOeY/daEZahFmXA58EDDhwB6oad6UPtZtIun CThDe9ejkdcnEruqV1+bMd19xjJ69Amw3TBWHo7fJaCOweq46xc/2HGcb1wDCRN0ovk+ X/Gg== X-Gm-Message-State: AOJu0Yx/LnrQodpRDK/2OW6/Q3imtpFGRaP3i3KDN82FISH1YtzrWF1+ Wqnnt74ckRDaP08xPI586sEV9Qv5V0m3O+fST4FcXr6OwS89w116XK0Wk9i1s3Zk+V3zjjYFPGM Ls4cw42TqLctx7ySt4lfeXhn+WeU5SzDP8oi+YNU3uiqt0O9n X-Gm-Gg: ASbGncvnZrKTt4hmga6v442d63LYW24iclKEhZ+7nhBqcC1FWBr7c8UITqY4zRPAKzI RpygEg/msDTcruJZ/+K8PCFngx6RYgDvqEWgr85IxxZBbdPl0YuEnUogfvzQ92dp8YGv2v8OXMe n8iWEiDK5BCRI/cyHrXIJGnTRrwLh/nTYtF2vtf7Zlj35AsjRafKTajs/BFL+6l/pgdE6S7hQr8 Pnx/I8aYbxs49S9jP4AhX2kR9KkytG1SEZivuZ9iaxqv8LeqHER X-Received: by 2002:a05:6000:4b0a:b0:385:fae2:f443 with SMTP id ffacd0b85a97d-38a87313975mr18780146f8f.34.1736774195625; Mon, 13 Jan 2025 05:16:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IFwBMYQqXPQxzZdc6FGJ8e2Lbj3PmWZBYhXw8lnFx0RiF7sjzN8pyjkFTORSuuscZKg5QTaCw== X-Received: by 2002:a05:6000:4b0a:b0:385:fae2:f443 with SMTP id ffacd0b85a97d-38a87313975mr18780120f8f.34.1736774195249; Mon, 13 Jan 2025 05:16:35 -0800 (PST) Received: from localhost ([2a09:80c0:192:0:5dac:bf3d:c41:c3e7]) by smtp.gmail.com with UTF8SMTPSA id 5b1f17b1804b1-436e2e92dc4sm176071985e9.39.2025.01.13.05.16.25 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 13 Jan 2025 05:16:33 -0800 (PST) From: David Hildenbrand To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, David Hildenbrand , Andrew Morton , Muchun Song , "Matthew Wilcox (Oracle)" Subject: [PATCH v2 1/6] mm/huge_memory: convert has_hwpoisoned into a pure folio flag Date: Mon, 13 Jan 2025 14:16:06 +0100 Message-ID: <20250113131611.2554758-2-david@redhat.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250113131611.2554758-1-david@redhat.com> References: <20250113131611.2554758-1-david@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: c-8QIsegqIaL42Z-gONk1RzdgsSiFY0OHgUFSvL_DJA_1736774196 X-Mimecast-Originator: redhat.com content-type: text/plain; charset="US-ASCII"; x-default=true X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: BA8251A0004 X-Stat-Signature: 939de58t8swxhsn47tp4gob6uszrudjk X-Rspam-User: X-HE-Tag: 1736774199-277887 X-HE-Meta: U2FsdGVkX189BFgXE/Xn9NpHpLnUyNQyh+oY660jGXjK4X2iQf09EJMO7xRikfpYi6PpzXis0n4wEpGMGeYHBC/DQLNkQrFzTWPwVvjiKhjxfOFUlgptqK81I1lAPu2qYxPrwza6QLHQiRSXz/SiGq3JP+mP6sYAcpfOi25eECurqceorUtbi1Ccb/kI9Dvb/i412JRLfL0/xK0fTyDp/1yZzj48oJwkhQq7swgsqXetE3trMM/sFdNv6JwzNN9AZ1CqfheQ5K1BHDbZnQQYxNDgKOsabd+8lSaKOQ8VhbGR+Lw2FnIOHmt2XDOINPwftrmLGI7W+Q+Kv8HQqZ4CXEirT3+5KE2wsMRtQxOKj6EmGxHcTy2Z6AkdZayMNOAkyhL2T7hpaZNUfw9ytvTsShPKz2lAY9H07YekS5WBVYmLop9GArJX1FzSVyFvP3SLoXr2CJ0MlatkMA1A5JKx81W/N2nf5DMQ1XJphK+sBdKf0ll7CoHPGxJknbjvKjriCGqZdxRzTFZMulSI8q0Kv2tP5KoFQlzrz7BM8+ni3R7OZt5oqf6o+n0z6Rs7FP4RvJqDCkhUAkicWu27WTEQXAViuISDDGSutqqBb9+g2aw2qLt3eC1h/W7v2ycvgCZiATGt1BbM4k50Jk7zgelbV7DGNsZCm4NtLHvqsAtl3+AE5kgEcZ+48chdBLvg+9CRzcSeQEVhrhco/Yws+wKxO5uWgui9S1yBdqk0Ny/2DH9mL778PSyuUwXSsQGgZDct+LafL+IzPSD9knT2Fl6Kym4NPRs60LbhynxdoLYiglcEfyLjJpZ3h3yHDuQjCuhJjVvFLfE0zGyNx1zhvlhoIX/IXBGdlIDrE/nbc8BZSYRzdSV2wfOD09vnJKXOq61IY2feah16e5VEfuVwKcXJKl4TVkQ9cnbYuJzNChcFpb7HUN7NJqun4zXIFcjq3JOk7q/kIqrhXlKfsaXiZAD AhWMpFwL rs0lhsq3qQ+o3BSSfyMAuPC1avhLdkKySFmlURQ061EI+beyGA450qRQndcd1GC4nK3wZqh+tFLbGMTKbM/Wcyi5bVkxtA2aOn6GSF4uxCNwL80Uz3IFOnmiOwguq+2s56QphmAVbowjzMsYjkZFZ45/Wkz6FQgw7cjgGjcRDoVMMqMo+HMyH9+ztXmv1jlM3XN/TBuGmsIqdcrhUw1JmLOX3GE90upZbXpuXE+HGjgRh13eNdxUhae2x0ZcVQmwXYNHNx0VDvPJLtgbjwnWk/UJZM8yfetUV4VRJLU0mBI7sp0dh2kDuvm7Y9NPsYXEW/3eMf24cjMKkVmPmDrSAm6OZnCgDy4ABL10CTItPX8YvHKLMxdZTTHD3zIRdJZp9WxHaJ3pjxn0cM/OwsHWhcda1wphn6fj2Vb9U4vQKi+RdMSE5kdDeihVTGrYlxyko5d72gMRcgvPq+k1wmhTExOvTlhUitn/m+N0vqnDEyXqPLtewOIhsC1Qm3yjDmtM3oYOe59PRhVc74K07H6EWczCWtOPTaY9JrFgoNIF+j5qZjlOTOhNChfVKaQ== 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: List-Subscribe: List-Unsubscribe: Let's stop setting it on pages, there is no need to anymore. Reviewed-by: Matthew Wilcox (Oracle) Signed-off-by: David Hildenbrand --- include/linux/page-flags.h | 6 ++---- mm/huge_memory.c | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 14226d6bd6f84..3f6a64ff968a7 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h @@ -948,11 +948,9 @@ TESTPAGEFLAG_FALSE(TransCompound, transcompound) * * This flag is set by hwpoison handler. Cleared by THP split or free page. */ -PAGEFLAG(HasHWPoisoned, has_hwpoisoned, PF_SECOND) - TESTSCFLAG(HasHWPoisoned, has_hwpoisoned, PF_SECOND) +FOLIO_FLAG(has_hwpoisoned, FOLIO_SECOND_PAGE) #else -PAGEFLAG_FALSE(HasHWPoisoned, has_hwpoisoned) - TESTSCFLAG_FALSE(HasHWPoisoned, has_hwpoisoned) +FOLIO_FLAG_FALSE(has_hwpoisoned) #endif /* diff --git a/mm/huge_memory.c b/mm/huge_memory.c index 2654a95487499..3d3ebdc002d59 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -3290,7 +3290,7 @@ static void __split_huge_page(struct page *page, struct list_head *list, /* lock lru list/PageCompound, ref frozen by page_ref_freeze */ lruvec = folio_lruvec_lock(folio); - ClearPageHasHWPoisoned(head); + folio_clear_has_hwpoisoned(folio); for (i = nr - new_nr; i >= new_nr; i -= new_nr) { struct folio *tail;