Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp3032511imm; Tue, 4 Sep 2018 14:15:07 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaZWkeKI7zXIN2aEHthgrlp8W1QosL1ppmSmf7s0UVFMtWOaOyVdH+rnLwD4wghh7AxR9WZ X-Received: by 2002:a62:e218:: with SMTP id a24-v6mr36111842pfi.75.1536095706956; Tue, 04 Sep 2018 14:15:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536095706; cv=none; d=google.com; s=arc-20160816; b=lK8egVf2G8S2q53Ug7Shym2LN3G3+QUhoeBfoDcssK/uABnlhewO4P6PVUfNakoMw/ arW1guwLyy44cDbFznPMqUbjOPkjqeWMzGWlU87HpTJarcM7NZziZS+SRc7rONgyauwE Jz3XVor1mQLLFwmxTa53bc/f2ooUmGLHmA61gpfmPXb77+I0jWcYouHo1fqkq2osfpHw hx+llcE6dWyNDzsvEDb4AsL/YBq/NcfU/5VDhKD5HmcF7KfyCYAo8FOv7aHDhZ9GYOFB ojM/F3e33Jcpk0xa1akDtiGFX8ZS85R5ugByLlWgHPMCKj7KH2RqXhOG9SBUbqlOIZTI D6yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=+8gbxUQw4SEPFFxDJfJSY3qSRPnMUocrd4TD9y9CMXg=; b=QoBX0Ect9Zmc7EjS912YqGz1cAgav0lsQvdj/rk79Xol1ooY+szAb+jxSYRQI1hfhQ 3KMazk66EDAZHQtl224nCw4S/ME1q/sJ0Lpa1ZtQDKMTZkIBlOJgLujpOtaTU0TkViRV SkmR7gy7aLfAaeGdCM2TrTZ5BnZlOJczM43K1rBMEkvhrdWSDFDkZtDMkorJm/b9gKv/ m2Fzf/S8FGcY/GH1TWJ7DMuWFpPbAoCnVIRiTEPGecVCIfUCq1n98k86L5JrpfBs10/Q nYrvzztv5ndpLbRYH9XmgxRBeZaUcbEs/3cLjOblbGcHv6ziYfccV1w38cGEkLnEw0L3 EhNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ZdQQ56V2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s71-v6si23193244pfa.367.2018.09.04.14.14.50; Tue, 04 Sep 2018 14:15:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ZdQQ56V2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726706AbeIEBkf (ORCPT + 99 others); Tue, 4 Sep 2018 21:40:35 -0400 Received: from mail-it0-f65.google.com ([209.85.214.65]:53191 "EHLO mail-it0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726090AbeIEBkf (ORCPT ); Tue, 4 Sep 2018 21:40:35 -0400 Received: by mail-it0-f65.google.com with SMTP id h3-v6so7050202ita.2 for ; Tue, 04 Sep 2018 14:13:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=+8gbxUQw4SEPFFxDJfJSY3qSRPnMUocrd4TD9y9CMXg=; b=ZdQQ56V2+k57LAXaIip/tDRtYPpxlyy7HJu3MvfVRW7PSzqYDtVVjO1cld480xvmY0 73tRwRZQ27P9MNDf9Wa+XwGj7a553AJD/5fhwXVikOlaRJQUfgadY2LoNuAnGfzBOw3q 9P42hPBKjgVTUmog+y15ncw5cx7/DnrQ2WrAWQJ0Ti+iLPagUTk+ttlENh4cU28xLIox OetgIRpISCoBqzcvVbyVjBQzSLfZuIAJTwd1Q0j5CZqVZ7qBQf00Q8WmHSa6435ld9MY ipkM7ZtCbl84hVA0vmJ3OHc2q+NM+iQOHOyD9mgbIipfvz2ioY0e9WfaRcr7jTlwIiSw k0fQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=+8gbxUQw4SEPFFxDJfJSY3qSRPnMUocrd4TD9y9CMXg=; b=rwDCrJjW8kYwVP5iRfGWQk30Ty1MlJWC2/DtZRUBVHa/3qDyBLpsfuzsCV3Jx8mlmz abaoG5i5U1CFxp0uZ2obIFuXLlWDG9PaUeaJm1GNsXTb9LyqHcF5yPiDq5qpJO2eahDe enOFgNUfx8LNcbEHkS5Lt//cDpOmppewvpt5MTG1ifCAPlf5hWxoHK0Q5HAwsX54p4xm HbUtMQ5ALJq8zrvj2VMOGw9Aoomz9Xipg/ZEkcWhJg1YlGSlN1C/oiP4lXPprpOWDEa7 FU/Gj4vIi/FXCrCWm5hkdg/jYPv4tSJXAcC1Y9t2b8o6BlKoaRXpj2eExkxNMGyhMH5I a1YA== X-Gm-Message-State: APzg51DvulBsqutey96o/QHlM1dnwxR4Ms503efa4h05h3IodQHn8z6s qVmhM5Noq2ZHeF8V/SnIzOEjgIbv5ziCAF79Aho= X-Received: by 2002:a24:918d:: with SMTP id i135-v6mr1696861ite.98.1536095621074; Tue, 04 Sep 2018 14:13:41 -0700 (PDT) MIME-Version: 1.0 References: <20180904181550.4416.50701.stgit@localhost.localdomain> <20180904183339.4416.44582.stgit@localhost.localdomain> <47657613-688d-e701-4a30-39fbd92734ba@microsoft.com> In-Reply-To: <47657613-688d-e701-4a30-39fbd92734ba@microsoft.com> From: Alexander Duyck Date: Tue, 4 Sep 2018 14:13:29 -0700 Message-ID: Subject: Re: [PATCH 1/2] mm: Move page struct poisoning from CONFIG_DEBUG_VM to CONFIG_DEBUG_VM_PGFLAGS To: Pavel.Tatashin@microsoft.com Cc: linux-mm , LKML , "Duyck, Alexander H" , Michal Hocko , Andrew Morton , Ingo Molnar , "Kirill A. Shutemov" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 4, 2018 at 1:07 PM Pasha Tatashin wrote: > > Hi Alexander, > > This is a wrong way to do it. memblock_virt_alloc_try_nid_raw() does not > initialize allocated memory, and by setting memory to all ones in debug > build we ensure that no callers rely on this function to return zeroed > memory just by accident. I get that, but setting this to all 1's is still just debugging code and that is adding significant overhead. > And, the accidents are frequent because most of the BIOSes and > hypervisors zero memory for us. The exception is kexec reboot. > > So, the fact that page flags checks this pattern, does not mean that > this is the only user. Memory that is returned by > memblock_virt_alloc_try_nid_raw() is used for page table as well, and > can be used in other places as well that don't want memblock to zero the > memory for them for performance reasons. The logic behind this statement is confusing. You are saying they don't want memblock to zero the memory for performance reasons, yet you are setting it to all 1's for debugging reasons? I get that it is wrapped, but in my mind just using CONFIG_DEBUG_VM is too broad of a brush. Especially with distros like Fedora enabling it by default. > I am surprised that CONFIG_DEBUG_VM is used in production kernel, but if > so perhaps a new CONFIG should be added: CONFIG_DEBUG_MEMBLOCK > > Thank you, > Pavel I don't know about production. I am running a Fedora kernel on my development system and it has it enabled. It looks like it has been that way for a while based on a FC20 Bugzilla (https://bugzilla.redhat.com/show_bug.cgi?id=1074710). A quick look at one of my CentOS systems shows that it doesn't have it set. I suspect it will vary from distro to distro. I just know it spooked me when I was stuck staring at a blank screen for three minutes when I was booting a system with 12TB of memory since this delay can hit you early in the boot. I had considered adding a completely new CONFIG. The only thing is it doesn't make much sense to have the logic setting the value to all 1's without any logic to test for it. That is why I thought it made more sense to just fold it into CONFIG_DEBUG_VM_PGFLAGS. I suppose I could look at something like CONFIG_DEBUG_PAGE_INIT if we want to go that route. I figure using something like MEMBLOCK probably wouldn't make sense since this also impacts sparse section init. Thanks. - Alex