From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0699AC4363A for ; Wed, 28 Oct 2020 08:38:37 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 569722462E for ; Wed, 28 Oct 2020 08:38:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="HA4BaE1H" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 569722462E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id BCBC46B006E; Wed, 28 Oct 2020 04:38:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BA1AB6B0070; Wed, 28 Oct 2020 04:38:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A90DB6B0071; Wed, 28 Oct 2020 04:38:35 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0049.hostedemail.com [216.40.44.49]) by kanga.kvack.org (Postfix) with ESMTP id 7E7436B006E for ; Wed, 28 Oct 2020 04:38:35 -0400 (EDT) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 23D2F3620 for ; Wed, 28 Oct 2020 08:38:35 +0000 (UTC) X-FDA: 77420682990.19.stove20_330d7db27283 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin19.hostedemail.com (Postfix) with ESMTP id F1D651AD1B9 for ; Wed, 28 Oct 2020 08:38:34 +0000 (UTC) X-HE-Tag: stove20_330d7db27283 X-Filterd-Recvd-Size: 4452 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by imf09.hostedemail.com (Postfix) with ESMTP for ; Wed, 28 Oct 2020 08:38:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1603874313; 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=KF3dZpaKBz60wjyXLMIZR7CSufQKGq5TkHGNntqeXuk=; b=HA4BaE1Hdt/9alf6hpbQSwcJyHhPVVZlH7hZUAOkg9Hc+/HZqJyoJfcnbmDj77spRhWBkZ HtY8hT0RSCETFxVNWbiIB19eFBHI/smMz9i8soJ/pKHG1LhwVnFezxCvSeVfTz/rrbdkKs qTftiv0QaOABFBr7T637nRY0LtRk0FQ= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-46-QA3PlxqyPS-IH2Msm5Gj_A-1; Wed, 28 Oct 2020 04:38:29 -0400 X-MC-Unique: QA3PlxqyPS-IH2Msm5Gj_A-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EEE211084CA1; Wed, 28 Oct 2020 08:38:27 +0000 (UTC) Received: from [10.36.114.138] (ovpn-114-138.ams2.redhat.com [10.36.114.138]) by smtp.corp.redhat.com (Postfix) with ESMTP id EAF5A5C1D7; Wed, 28 Oct 2020 08:38:25 +0000 (UTC) Subject: Re: [PATCH 3/3] mm, page_alloc: reduce static keys in prep_new_page() To: Vlastimil Babka , Andrew Morton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Alexander Potapenko , Kees Cook , Michal Hocko , Mateusz Nosek , Laura Abbott References: <20201026173358.14704-1-vbabka@suse.cz> <20201026173358.14704-4-vbabka@suse.cz> <93ab79df-cf8c-294b-3ed1-8a563e4a452b@redhat.com> <1fc7ec3a-367c-eb9f-1cb4-b9e015fea87c@suse.cz> <81faf3d6-9536-ff00-447d-e964a010492d@suse.cz> <38de5bb0-5559-d069-0ce0-daec66ef2746@suse.cz> From: David Hildenbrand Organization: Red Hat GmbH Message-ID: <1d131524-6383-fb37-00e7-ba52ae6de66b@redhat.com> Date: Wed, 28 Oct 2020 09:38:25 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <38de5bb0-5559-d069-0ce0-daec66ef2746@suse.cz> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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: On 27.10.20 18:41, Vlastimil Babka wrote: > On 10/27/20 2:32 PM, Vlastimil Babka wrote: >> So my conclusion: >> - We can remove PAGE_POISONING_NO_SANITY because it only makes sense with >> PAGE_POISONING_ZERO, and we can use init_on_free instead > > Note for this we first have to make sanity checking compatible with > hibernation, but that should be easy as the zeroing variants already > paved the way. The patch below will be added to the next version of > the series: > > From 44474ee27c4f5248061ea2e5bbc2aeefc91bcdfc Mon Sep 17 00:00:00 2001 > From: Vlastimil Babka > Date: Tue, 27 Oct 2020 18:25:17 +0100 > Subject: [PATCH] kernel/power: allow hibernation with page_poison sanity > checking > > Page poisoning used to be incompatible with hibernation, as the state of > poisoned pages was lost after resume, thus enabling CONFIG_HIBERNATION forces > CONFIG_PAGE_POISONING_NO_SANITY. For the same reason, the poisoning with zeroes > variant CONFIG_PAGE_POISONING_ZERO used to disable hibernation. The latter > restriction was removed by commit 1ad1410f632d ("PM / Hibernate: allow > hibernation with PAGE_POISONING_ZERO") and similarly for init_on_free by commit > 18451f9f9e58 ("PM: hibernate: fix crashes with init_on_free=1") by making sure > free pages are cleared after resume. > > We can use the same mechanism to instead poison free pages with PAGE_POISON > after resume. This covers both zero and 0xAA patterns. Thus we can remove the > Kconfig restriction that disables page poison sanity checking when hibernation > is enabled. I haven't fully dived into the details, but the idea it sounds sane to me. -- Thanks, David / dhildenb