Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1379332pxf; Fri, 26 Mar 2021 06:53:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxSImuDn1gj7XhpQ+WDK1qNUK8jVaE9JKJgupN0r8KI/uasjAdHOajF84M/xFTQ25MwNAa+ X-Received: by 2002:a17:907:33cd:: with SMTP id zk13mr15392233ejb.224.1616766827264; Fri, 26 Mar 2021 06:53:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616766827; cv=none; d=google.com; s=arc-20160816; b=B3tKpUNXSxBnSDBtkjlrFYS3cbmQQmj3YEh0Ad9nZSGR/tFckoGVmYZAUURm3S812c elWA98GdIqDBvKAoOUYh9CNR7laDgkdrA4Iy3kb999MZM5qrvhTPJ98aSmo0dOVpquuE lzYL1jS9tugMyyh1NtMIqKk8sP8zYY8oFaMoBxWEq0mIqFz3VuZlViZ8yKxoI8Z8ZoMR 6feK8DsrDwVJDmB3ZLsgrhgBMKFRdnTcWH2cqo2jzP9FwQOhppyfBuKcso3oWxzxmFCK lXkC+/cXjwBsXPOIDELESbqHK2avEbx9//KdqcCuH/QK7fMOFuifc36sOR6rNoclMXSr 8GNw== 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:subject :organization:from:references:cc:to:dkim-signature; bh=OEnn8bd6lr+qtup9/k0dDhgruQ7f47v/nXPyuUZSu18=; b=lP2X6ppKWrnFR3P28NuFtpyySuRdTukbqtSFy/E/MFGoIsauKYvbvRPfwXE02UASw6 JWuDIdjNzKuecYpc/Q7qrK2twoxUR/FJVQJyaRXRK/ahRlWAlPmktkcUdchMjEOICmb3 /VaGqRO1W6hj+cqt0avyT7Eb0ptmYp0U/zb/PRrxei8MoqWQk9BGce8jE/4eQS6bAkT0 gO6TMxX3CupQuVqWnwU8rgujU+vi6EvPZ7saferYl3k4aLVR5qJojBEqRJhRbLSLMCRS 6AhIHES8yGR14s0R3eVCqULdz3//yP6r6cveeV4CCBH2ad+LSZs0oZbPsdgIifgdWxV+ jxnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=IKjx64FM; 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 j22si6891010edq.584.2021.03.26.06.53.24; Fri, 26 Mar 2021 06:53:47 -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=IKjx64FM; 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 S230221AbhCZNuG (ORCPT + 99 others); Fri, 26 Mar 2021 09:50:06 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:43047 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229976AbhCZNto (ORCPT ); Fri, 26 Mar 2021 09:49:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616766583; 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=IKjx64FMI/V2jGNjj7Hz99yv3PuKa/P3gxmO1v/JT7r/TpygipRUFvAq9orFRJemHrulE1 1GxyiMaRFgsk0KuCNScnLCAq2JmKK6Xnx9aPu2aWp9RPC47DHUVn+nTkoIIsJMapsjeVSr iVBtNODT0/t3fBQ4Ozb+KsMM07J764I= 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 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 26.03.21 12:26, Sergei Trofimovich wrote: > init_on_free=1 does not guarantee that free pages contain only zero bytes. > > Some examples: > 1. page_poison=on takes presedence over init_on_alloc=1 / ini_on_free=1 s/ini_on_free/init_on_free/ > 2. free_pages_prepare() always poisons pages: > > 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 > > I observed use of poisoned pages as the crash on ia64 booted with > init_on_free=1 init_on_alloc=1 (CONFIG_PAGE_POISONING=y config). > There pmd page contained 0xaaaaaaaa poison pages and led to early crash. > > The change drops the assumption that init_on_free=1 guarantees free > pages to contain zeros. > > Alternative would be to make interaction between runtime poisoning and > sanitizing options and build-time debug flags like CONFIG_PAGE_POISONING > more coherent. I took the simpler path. > I thought latest work be Vlastimil tried to tackle that. To me, it feels like page_poison=on and init_on_free=1 should bail out and disable one of both things. Having both at the same time doesn't sound helpful. > Tested the fix on rx3600. Fixes: ? -- Thanks, David / dhildenb