From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl0-f70.google.com (mail-pl0-f70.google.com [209.85.160.70]) by kanga.kvack.org (Postfix) with ESMTP id 45F7A6B0005 for ; Tue, 15 May 2018 05:10:44 -0400 (EDT) Received: by mail-pl0-f70.google.com with SMTP id f35-v6so13534235plb.10 for ; Tue, 15 May 2018 02:10:44 -0700 (PDT) Received: from mx2.suse.de (mx2.suse.de. [195.135.220.15]) by mx.google.com with ESMTPS id f69-v6si5608226plb.503.2018.05.15.02.10.43 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 15 May 2018 02:10:43 -0700 (PDT) Date: Tue, 15 May 2018 11:10:36 +0200 From: Michal Hocko Subject: Re: [PATCH v2] mm: allow deferred page init for vmemmap only Message-ID: <20180515091036.GC12670@dhcp22.suse.cz> References: <20180510115356.31164-1-pasha.tatashin@oracle.com> <20180510123039.GF5325@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: owner-linux-mm@kvack.org List-ID: To: Pavel Tatashin Cc: Steven Sistare , Daniel Jordan , Andrew Morton , LKML , tglx@linutronix.de, Linux Memory Management List , mgorman@techsingularity.net, mingo@kernel.org, peterz@infradead.org, Steven Rostedt , Fengguang Wu , Dennis Zhou On Fri 11-05-18 10:17:55, Pavel Tatashin wrote: > > Thanks that helped me to see the problem. On the other hand isn't this a > > bit of an overkill? AFAICS this affects only NEED_PER_CPU_KM which is !SMP > > and DEFERRED_STRUCT_PAGE_INIT makes only very limited sense on UP, > > right? > > > Or do we have more such places? > > I do not know other places, but my worry is that trap_init() is arch > specific and we cannot guarantee that arches won't do virt to phys in > trap_init() in other places. Therefore, I think a proper fix is simply > allow DEFERRED_STRUCT_PAGE_INIT when it is safe to do virt to phys without > accessing struct pages, which is with SPARSEMEM_VMEMMAP. You are now disabling a potentially useful feature to SPARSEMEM users without having any evidence that they do suffer from the issue which is kinda sad. Especially when the only known offender is a UP pcp allocator implementation. I will not insist of course but it seems like your fix doesn't really prevent virt_to_page or other direct page access either. -- Michal Hocko SUSE Labs