From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933266AbcINWF4 (ORCPT ); Wed, 14 Sep 2016 18:05:56 -0400 Received: from mail-oi0-f47.google.com ([209.85.218.47]:36278 "EHLO mail-oi0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760075AbcINWFx (ORCPT ); Wed, 14 Sep 2016 18:05:53 -0400 MIME-Version: 1.0 In-Reply-To: <8B91B5C5-4506-40CB-B7F0-0990A37F95AA@amazon.de> References: <1466244679-23824-1-git-send-email-karahmed@amazon.de> <20160620082339.GC4340@dhcp22.suse.cz> <8B91B5C5-4506-40CB-B7F0-0990A37F95AA@amazon.de> From: Dan Williams Date: Wed, 14 Sep 2016 15:05:51 -0700 Message-ID: Subject: Re: [PATCH] sparse: Track the boundaries of memory sections for accurate checks To: "Raslan, KarimAllah" Cc: Michal Hocko , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , Andrew Morton , Mel Gorman , Vlastimil Babka , Johannes Weiner , Yaowei Bai , Joe Perches , Tejun Heo , "Liguori, Anthony" , "Schoenherr, Jan H." Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 14, 2016 at 2:40 PM, Raslan, KarimAllah wrote: > > > On 6/20/16, 10:23 AM, "Michal Hocko" wrote: > > On Sat 18-06-16 12:11:19, KarimAllah Ahmed wrote: > > When sparse memory model is used an array of memory sections is created to > > track each block of contiguous physical pages. Each element of this array > > contains PAGES_PER_SECTION pages. During the creation of this array the actual > > boundaries of the memory block is lost, so the whole block is either considered > > as present or not. > > > > pfn_valid() in the sparse memory configuration checks which memory sections the > > pfn belongs to then checks whether it's present or not. This yields sub-optimal > > results when the available memory doesn't cover the whole memory section, > > because pfn_valid will return 'true' even for the unavailable pfns at the > > boundaries of the memory section. > > Please be more verbose of _why_ the patch is needed. Why those > "sub-optimal results" matter? > > Does this make sense to you ? [ channeling my inner akpm ] What's the user visible effect of this change? What code is getting tripped up by pfn_valid() being imprecise, and why is changing pfn_valid() the preferred fix? From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-it0-f70.google.com (mail-it0-f70.google.com [209.85.214.70]) by kanga.kvack.org (Postfix) with ESMTP id 2DA106B0038 for ; Wed, 14 Sep 2016 18:06:07 -0400 (EDT) Received: by mail-it0-f70.google.com with SMTP id e20so89576895itc.0 for ; Wed, 14 Sep 2016 15:06:07 -0700 (PDT) Received: from mail-oi0-x232.google.com (mail-oi0-x232.google.com. [2607:f8b0:4003:c06::232]) by mx.google.com with ESMTPS id 37si183252otb.5.2016.09.14.15.05.52 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Sep 2016 15:05:52 -0700 (PDT) Received: by mail-oi0-x232.google.com with SMTP id m11so43745722oif.1 for ; Wed, 14 Sep 2016 15:05:52 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <8B91B5C5-4506-40CB-B7F0-0990A37F95AA@amazon.de> References: <1466244679-23824-1-git-send-email-karahmed@amazon.de> <20160620082339.GC4340@dhcp22.suse.cz> <8B91B5C5-4506-40CB-B7F0-0990A37F95AA@amazon.de> From: Dan Williams Date: Wed, 14 Sep 2016 15:05:51 -0700 Message-ID: Subject: Re: [PATCH] sparse: Track the boundaries of memory sections for accurate checks Content-Type: text/plain; charset=UTF-8 Sender: owner-linux-mm@kvack.org List-ID: To: "Raslan, KarimAllah" Cc: Michal Hocko , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , Andrew Morton , Mel Gorman , Vlastimil Babka , Johannes Weiner , Yaowei Bai , Joe Perches , Tejun Heo , "Liguori, Anthony" , "Schoenherr, Jan H." On Wed, Sep 14, 2016 at 2:40 PM, Raslan, KarimAllah wrote: > > > On 6/20/16, 10:23 AM, "Michal Hocko" wrote: > > On Sat 18-06-16 12:11:19, KarimAllah Ahmed wrote: > > When sparse memory model is used an array of memory sections is created to > > track each block of contiguous physical pages. Each element of this array > > contains PAGES_PER_SECTION pages. During the creation of this array the actual > > boundaries of the memory block is lost, so the whole block is either considered > > as present or not. > > > > pfn_valid() in the sparse memory configuration checks which memory sections the > > pfn belongs to then checks whether it's present or not. This yields sub-optimal > > results when the available memory doesn't cover the whole memory section, > > because pfn_valid will return 'true' even for the unavailable pfns at the > > boundaries of the memory section. > > Please be more verbose of _why_ the patch is needed. Why those > "sub-optimal results" matter? > > Does this make sense to you ? [ channeling my inner akpm ] What's the user visible effect of this change? What code is getting tripped up by pfn_valid() being imprecise, and why is changing pfn_valid() the preferred fix? -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org