Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp255067pxx; Thu, 29 Oct 2020 01:36:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw2/mePxTU9UgL8P0Qn++X+2Y0tSUdfwtNtXKCh872lg+iRaXaOZ5RP6IKZ1vyV554RlLr1 X-Received: by 2002:aa7:d384:: with SMTP id x4mr2870699edq.105.1603960596378; Thu, 29 Oct 2020 01:36:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603960596; cv=none; d=google.com; s=arc-20160816; b=gI5jcVBfvWYRDm2FCrkhJIM1zPa16bJEAepd61swZMu4lMqyANETpde78fQ/6rAtej +dym50Q59By8A9voLh/VSxTlN5aBtbuCU+n+OFVbwsy55rZ0O3Z3aRpUCgM9nHLkPIr8 ZwMeHIaSITEiA6xAO5SZjABkofTRR525e+mbqGFiQTzXCYZJpdYD5f/4Zba5bqJS16oy gcSQkW40Lp/aP4khcbNjmO6JVvlXh1j2rDj2SFFN4dMg5BWOVCmPCEgNqjho4jBpUpBx iNHGRve//ueBpJz+OM9Edrc2TF7uo5g36XSQhkrO1aPbRh+3uxBk41HIPCZYF3XoB7ze Phqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:organization :from:references:cc:to:subject:dkim-signature; bh=KF3dZpaKBz60wjyXLMIZR7CSufQKGq5TkHGNntqeXuk=; b=KQB/iVUW7/MNyAiugo/+bFqbp/za8UbQL6lPeGgddB2rpWiKPuojpbJHisyc/5i/4l mKfjsjKTMURIpkwZRA3GHa5Uye54CHR9EukeIqZfuHVLdvBBW89yil1BZcz0zF1Ij5o3 UaqB6o6wYi3OW+wAOTin8RFOQxDhEwlk9hI2fA+Yg6AF+OMLDcJSnKJbAtR9h/SGYtP0 1qDHwTY+RWeVg2A0XFNdT6zX2omvcCQ04PJb/OAYPYqbdZ8skmyApGbcvxZZpG0XUIo8 TF/C7wEYbp5w0EMRgnomHIxjfIpqD9qwHjs0ldBJlpCBVLNTtjY4GJQc3xsf0XXNVSmA edhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=b03p4lj0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d2si1461622edn.245.2020.10.29.01.36.13; Thu, 29 Oct 2020 01:36:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=b03p4lj0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388835AbgJ2AkN (ORCPT + 99 others); Wed, 28 Oct 2020 20:40:13 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:50531 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729273AbgJ2AkL (ORCPT ); Wed, 28 Oct 2020 20:40:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1603932010; 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=b03p4lj0n9Sxlhknq5F1qSa3NZsXBCJtkuwREnM2lrREqUME/S9LFmck9pq/unFfCB5LbW aiYc7JrVeow5LaSyTSjiPDPSeoE7bABM+Px1aP4Eigrx/tD2riKY+OL9Kn0wRDVz0EB881 wYCBXY0ncYRUVx0HBfmLG0QJyLGLsEU= 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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