Message ID | 20240522210341.1030552-5-david@redhat.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 EC780C25B78 for <linux-mm@archiver.kernel.org>; Wed, 22 May 2024 21:04:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 783B86B009A; Wed, 22 May 2024 17:04:04 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6EBF26B009C; Wed, 22 May 2024 17:04:04 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5856B6B009B; Wed, 22 May 2024 17:04:04 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 393C86B0099 for <linux-mm@kvack.org>; Wed, 22 May 2024 17:04:04 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id B19D11A4C0F for <linux-mm@kvack.org>; Wed, 22 May 2024 21:04:03 +0000 (UTC) X-FDA: 82147259166.23.DB80C40 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf07.hostedemail.com (Postfix) with ESMTP id E418440011 for <linux-mm@kvack.org>; Wed, 22 May 2024 21:04:01 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=ZXqd8BQX; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf07.hostedemail.com: domain of david@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=david@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1716411842; 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=V6qRfeG4CVJz5l48G3FsZPf4ap0/Ubwcpkx8trvSrMU=; b=KxZ94WfOyJ4uoWWl7s4TvV188r+6/zVhJbX8Ip00yUQ4Lw9qA7or8fzQ2mWbm6JPe19OFI +i4N5YAyZpGGwdCNqtqc7CGFdq5zQn5TbQ411NwrjjCGoufjhxuRbsZipz8q6qMJh++9cR XtrkTPM0gyyF3YIAHKKVZCvBxu4R7Zo= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=ZXqd8BQX; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf07.hostedemail.com: domain of david@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=david@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1716411842; a=rsa-sha256; cv=none; b=4mhC5jlsqoZvkoKirHJ0Vn8XRcNW/Vexno3J8y7vgtjjBSfgGEdBULN/7y/X7c54KdabwR lTanR7udMIfHBhV+OHE6mjV58zoplvg8CPwyQYRshJRfdSz6RqvwxRzsIEesE33Xej9KyT mUCLuiKSG3l0iKy79MVgwyKb3qVnkD0= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716411841; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=V6qRfeG4CVJz5l48G3FsZPf4ap0/Ubwcpkx8trvSrMU=; b=ZXqd8BQXXaIQaZHIabCb7e1j2IwI5IX89oUA6oph2o02tMu3DZANjrPH7EmPKCpduPfWu5 Ss8lsUTHWVolSeNagID9vYzedVAdWyJNCm5NkRM2kr1j+zIfM4kC8xCTIfjDEsd2Yvi76Y qc3Grz8gyCUxb1ax6dEuLKNLT62jr2s= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-444-gaoAYFYkNC-gX_dN8vliYw-1; Wed, 22 May 2024 17:03:55 -0400 X-MC-Unique: gaoAYFYkNC-gX_dN8vliYw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 49F378008A4; Wed, 22 May 2024 21:03:55 +0000 (UTC) Received: from t14s.fritz.box (unknown [10.39.192.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5F27B7412; Wed, 22 May 2024 21:03:53 +0000 (UTC) From: David Hildenbrand <david@redhat.com> To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, David Hildenbrand <david@redhat.com>, Andrew Morton <akpm@linux-foundation.org>, "Matthew Wilcox (Oracle)" <willy@infradead.org>, Mike Rapoport <rppt@kernel.org>, Minchan Kim <minchan@kernel.org>, Sergey Senozhatsky <senozhatsky@chromium.org>, Hyeonggon Yoo <42.hyeyoo@gmail.com> Subject: [PATCH RFC 4/6] mm/page_alloc: clear PageBuddy using __ClearPageBuddy() for bad pages Date: Wed, 22 May 2024 23:03:39 +0200 Message-ID: <20240522210341.1030552-5-david@redhat.com> In-Reply-To: <20240522210341.1030552-1-david@redhat.com> References: <20240522210341.1030552-1-david@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 X-Rspamd-Queue-Id: E418440011 X-Stat-Signature: q1jp37g3aig5ewdii196wz93zk9r1o61 X-Rspam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dfdH5ngNHYXBvgMwUbU5ketRv71Qqwvwtzp95u8R003sQEH7uFgFwzHeh975meEMaBkFezAy91lOlXe2N9dxEkQfChe2RqwzHtPFwJ0QnrS+WI2lNDyWgof6sE8N6PUyO1N1xBFdTd7DBivRb3qr0QDRHJcFDaubrPluzht347JQnEvwzSoTOjMDMpdjcflC+fvl/TSi3t/XUBy9sdoOTIPpKgMRRDImU/5JvSc3YCqWFShbbSi9Ydm6o 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: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
mm: page_type, zsmalloc and page_mapcount_reset()
|
expand
|
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 2e22ce5675ca..b595342e73c2 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -498,7 +498,8 @@ static void bad_page(struct page *page, const char *reason) dump_stack(); out: /* Leave bad fields for debug, except PageBuddy could make trouble */ - page_mapcount_reset(page); /* remove PageBuddy */ + if (PageBuddy(page)) + __ClearPageBuddy(page); add_taint(TAINT_BAD_PAGE, LOCKDEP_NOW_UNRELIABLE); } @@ -1346,7 +1347,8 @@ static void check_new_page_bad(struct page *page) { if (unlikely(page->flags & __PG_HWPOISON)) { /* Don't complain about hwpoisoned pages */ - page_mapcount_reset(page); /* remove PageBuddy */ + if (PageBuddy(page)) + __ClearPageBuddy(page); return; }
Let's stop using page_mapcount_reset() and clear PageBuddy using __ClearPageBuddy() instead. Signed-off-by: David Hildenbrand <david@redhat.com> --- mm/page_alloc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)