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=-5.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,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 36824C433C1 for ; Fri, 26 Mar 2021 13:49:44 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9E5B261945 for ; Fri, 26 Mar 2021 13:49:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9E5B261945 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 077636B006C; Fri, 26 Mar 2021 09:49:43 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 027896B006E; Fri, 26 Mar 2021 09:49:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E0B0A6B0070; Fri, 26 Mar 2021 09:49:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0108.hostedemail.com [216.40.44.108]) by kanga.kvack.org (Postfix) with ESMTP id C518E6B006C for ; Fri, 26 Mar 2021 09:49:42 -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 7F4A8812D for ; Fri, 26 Mar 2021 13:49:42 +0000 (UTC) X-FDA: 77962158204.19.73D6C88 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf08.hostedemail.com (Postfix) with ESMTP id 3651F80192DD for ; Fri, 26 Mar 2021 13:49:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616766581; 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=OEnn8bd6lr+qtup9/k0dDhgruQ7f47v/nXPyuUZSu18=; b=SgdERENaAleo/1LMFut4gfSuAcGZu2L/jUuGF/+3TaYQNDWWi2wzkO7oJJWCe+35oJ7lPp MtkTHUWjwY7LlwQE7R1RolsORtI4iSQJBljIwCOuRMuRx8kb1nBNwY6SAq9db2N6B4Psws yfFGQAYz6JmjihYmap7zlJShLbhkYsY= 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-339-I31qHe6AMs6npWBWj5dXkQ-1; Fri, 26 Mar 2021 09:49:39 -0400 X-MC-Unique: I31qHe6AMs6npWBWj5dXkQ-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 1216110925AB; Fri, 26 Mar 2021 13:48:53 +0000 (UTC) Received: from [10.36.112.81] (ovpn-112-81.ams2.redhat.com [10.36.112.81]) by smtp.corp.redhat.com (Postfix) with ESMTP id ABCC479445; Fri, 26 Mar 2021 13:48:51 +0000 (UTC) To: Sergei Trofimovich , Andrew Morton , linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, Vlastimil Babka , Andrey Konovalov References: <20210326112650.307890-1-slyfox@gentoo.org> From: David Hildenbrand Organization: Red Hat GmbH Subject: Re: [PATCH] mm: page_alloc: ignore init_on_free=1 for page alloc Message-ID: <4e23d404-5125-6c9c-4aa7-5eff0fa1ba33@redhat.com> Date: Fri, 26 Mar 2021 14:48:50 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: <20210326112650.307890-1-slyfox@gentoo.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Stat-Signature: 93optstix8fxbowzikzi4cnneirp83es X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 3651F80192DD Received-SPF: none (redhat.com>: No applicable sender policy available) receiver=imf08; identity=mailfrom; envelope-from=""; helo=us-smtp-delivery-124.mimecast.com; client-ip=216.205.24.124 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1616766579-24326 Content-Transfer-Encoding: quoted-printable 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 26.03.21 12:26, Sergei Trofimovich wrote: > init_on_free=3D1 does not guarantee that free pages contain only zero b= ytes. >=20 > Some examples: > 1. page_poison=3Don takes presedence over init_on_alloc=3D1 / ini_on_fr= ee=3D1 s/ini_on_free/init_on_free/ > 2. free_pages_prepare() always poisons pages: >=20 > if (want_init_on_free()) > kernel_init_free_pages(page, 1 << order); > kernel_poison_pages(page, 1 << order In next/master, it's the other way around already. commit 855a9c4018f3219db8be7e4b9a65ab22aebfde82 Author: Andrey Konovalov Date: Thu Mar 18 17:01:40 2021 +1100 kasan, mm: integrate page_alloc init with HW_TAGS >=20 > I observed use of poisoned pages as the crash on ia64 booted with > init_on_free=3D1 init_on_alloc=3D1 (CONFIG_PAGE_POISONING=3Dy config). > There pmd page contained 0xaaaaaaaa poison pages and led to early crash= . >=20 > The change drops the assumption that init_on_free=3D1 guarantees free > pages to contain zeros. >=20 > Alternative would be to make interaction between runtime poisoning and > sanitizing options and build-time debug flags like CONFIG_PAGE_POISONIN= G > more coherent. I took the simpler path. >=20 I thought latest work be Vlastimil tried to tackle that. To me, it feels=20 like page_poison=3Don and init_on_free=3D1 should bail out and disable o= ne=20 of both things. Having both at the same time doesn't sound helpful. > Tested the fix on rx3600. Fixes: ? --=20 Thanks, David / dhildenb