Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp3423047imm; Tue, 4 Sep 2018 23:12:43 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaONu9KFXGPcONvJUhETYB5r+kahQSIOc7yKJn9iRyD93V2A7oNSZnOrrqaobn0cKuXu2LY X-Received: by 2002:a63:4b1f:: with SMTP id y31-v6mr34340367pga.14.1536127963861; Tue, 04 Sep 2018 23:12:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536127963; cv=none; d=google.com; s=arc-20160816; b=dH8og7h5g2ENdiYhd2OgZn8Wq9OcqQTWAkPgrUTr2H870VSSHnv0EZu1eHQGomD40L E//uCWNa5x8sJaxC4d0bBSXUjvMNyVHayqSCOipQjHZvdKFWOthCYPMThBYqoPUVxEBq PSEtipXRQhU46HX4MeLHbatyAk3WWe9mpeV0fVrKdg0pdUgxwV/e+yBjenOLvuFIqMtn uMZ3oM0+pKXEzIOnFy7dYkjAL9p7AalnzXpMIq6vwWatTdviWyDgJobNqAfVPLMKfAdO M1qMzDBLLl7CogBuEIBg7wbpKBxJOScJ83e0X4VkcJL0uISq0fGFtD9Yil0DgXrZmvQv 08Ew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=gL1cRenYa6gO8nZhpFBXMSbIyai/ZN6KTWXlfelXEJU=; b=hBq4VhsP63rCX9UpqMQT/BJmAI/Wnsw03EpKiwt4hXGx0692pTtvHic0XztONTiGa8 nH5aBmzcOt2NN6qASrNXp+6yJoIqIAlB6M1DiBuDowHQcGp4iVXF4mHOqGJ68TDYINjv 9rWAfSqla1P0o8e0oht7q0T811qqRR3kcv/xllgp/CYU6o4HH2UfqJrLSnRsbcYpt1uy 1SIKzdNsJJqMhJzdNj0SY2LCSPjHLdgIPT44DSNzFLad7yJ/gUQTNtGUgi+0+uVO8kPo vONQjXEoabUIfFF1XfLL1FjPyaWG6ZOZ7ZUQ0vLp097MfPavsiEBw19sqQxOhTc3tbos Uiww== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r8-v6si1010532pgs.144.2018.09.04.23.12.28; Tue, 04 Sep 2018 23:12:43 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727603AbeIEKjW (ORCPT + 99 others); Wed, 5 Sep 2018 06:39:22 -0400 Received: from mx2.suse.de ([195.135.220.15]:58736 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726299AbeIEKjW (ORCPT ); Wed, 5 Sep 2018 06:39:22 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id D6C57B0CE; Wed, 5 Sep 2018 06:10:46 +0000 (UTC) Date: Wed, 5 Sep 2018 08:10:44 +0200 From: Michal Hocko To: Alexander Duyck Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, alexander.h.duyck@intel.com, pavel.tatashin@microsoft.com, akpm@linux-foundation.org, mingo@kernel.org, kirill.shutemov@linux.intel.com Subject: Re: [PATCH 1/2] mm: Move page struct poisoning from CONFIG_DEBUG_VM to CONFIG_DEBUG_VM_PGFLAGS Message-ID: <20180905061044.GT14951@dhcp22.suse.cz> References: <20180904181550.4416.50701.stgit@localhost.localdomain> <20180904183339.4416.44582.stgit@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180904183339.4416.44582.stgit@localhost.localdomain> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 04-09-18 11:33:39, Alexander Duyck wrote: > From: Alexander Duyck > > On systems with a large amount of memory it can take a significant amount > of time to initialize all of the page structs with the PAGE_POISON_PATTERN > value. I have seen it take over 2 minutes to initialize a system with > over 12GB of RAM. > > In order to work around the issue I had to disable CONFIG_DEBUG_VM and then > the boot time returned to something much more reasonable as the > arch_add_memory call completed in milliseconds versus seconds. However in > doing that I had to disable all of the other VM debugging on the system. I agree that CONFIG_DEBUG_VM is a big hammer but the primary point of this check is to catch uninitialized struct pages after the early mem init rework so the intention was to make it enabled on as many systems with debugging enabled as possible. DEBUG_VM is not free already so it sounded like a good idea to sneak it there. > I did a bit of research and it seems like the only function that checks > for this poison value is the PagePoisoned function, and it is only called > in two spots. One is the PF_POISONED_CHECK macro that is only in use when > CONFIG_DEBUG_VM_PGFLAGS is defined, and the other is as a part of the > __dump_page function which is using the check to prevent a recursive > failure in the event of discovering a poisoned page. Hmm, I have missed the dependency on CONFIG_DEBUG_VM_PGFLAGS when reviewing the patch. My debugging kernel config doesn't have it enabled for example. I know that Fedora configs have CONFIG_DEBUG_VM enabled but I cannot find their config right now to double check for the CONFIG_DEBUG_VM_PGFLAGS right now. I am not really sure this dependency was intentional but I strongly suspect Pavel really wanted to have it DEBUG_VM scoped. -- Michal Hocko SUSE Labs