Received: by 10.223.164.202 with SMTP id h10csp453694wrb; Wed, 8 Nov 2017 20:29:07 -0800 (PST) X-Google-Smtp-Source: ABhQp+RPXT8fevkCAEgBUBvd7oPIQJ+thNGR4a5zqqFEXXHkHP63Jz8B0uQ8NZyl7vb0kKwt7nos X-Received: by 10.84.238.136 with SMTP id v8mr2546736plk.37.1510201747779; Wed, 08 Nov 2017 20:29:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510201747; cv=none; d=google.com; s=arc-20160816; b=DQGN4I2WT+of4JhJaazp8IO/WolrZKuS0EtgEmy9wYxs/17zJrfp1xebGsNjSbYvXj Wfot+BEceAx3hPeuPbd+o7UaHLG5ZbL1mMcu3Ai6IvNo2CabLqsjLxf3nbwla4P7Guxb FT9qBy1T1ecjfUcGEkJcLAmm/ql9iTkQ8mJcMnQLFFrfyRUvu+6AVzKZnPnC+tr6pNQi Y644txpIjBKoqWyTSz6sUZFR/EcYNMjRA58X/gTJXYTe7/m91Mnak7okkwGwW4LnyWjt eJ5lIUwx7tkfNbPxeK4JzpHPRNvXmHGNPPH5Vw6WNIfG5XAL0T1YqyY6dOreXYsWlRSl oX7w== 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:arc-authentication-results; bh=tNqbqbntgkBaiYTG0qmGZJkgwVQfn6/vdnr1LbqdnLc=; b=n0HniUKvti/d4q7mgRjvXr6mVBuChny6XNLvQiUus7SwG6UZk9W5cLxJofNs7lJUFt y+9ySgfv/4vrvl9OsbpgeyqxJ7PgtlT1ZJzDZCG1B/9ZiyB36cWxnLTYMijmxU595de8 zEVgEYRF7hhnBRW7fTPoKa6gDw5LW2E1hOEAO7c4p6/eboXLBqrdPh7hShYFE0i5uNrR 3KAfETzaEI74juhsRu3Gn+iidQkMP/rrL+2lcmum/PLyvXAPsVTROQfrgUPQrCgdIsQw gtKMUNv7xAA9GAhAphQJ57HYLjUeulZHIAaqYzUKuFNqZo4H1x5L54wBtCnGmG6xV9UC 8nkg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 72si5720409pfm.40.2017.11.08.20.28.56; Wed, 08 Nov 2017 20:29:07 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752296AbdKIE2T (ORCPT + 82 others); Wed, 8 Nov 2017 23:28:19 -0500 Received: from LGEAMRELO13.lge.com ([156.147.23.53]:59664 "EHLO lgeamrelo13.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751716AbdKIE2S (ORCPT ); Wed, 8 Nov 2017 23:28:18 -0500 Received: from unknown (HELO lgeamrelo02.lge.com) (156.147.1.126) by 156.147.23.53 with ESMTP; 9 Nov 2017 13:28:16 +0900 X-Original-SENDERIP: 156.147.1.126 X-Original-MAILFROM: iamjoonsoo.kim@lge.com Received: from unknown (HELO localhost) (10.177.222.138) by 156.147.1.126 with ESMTP; 9 Nov 2017 13:28:16 +0900 X-Original-SENDERIP: 10.177.222.138 X-Original-MAILFROM: iamjoonsoo.kim@lge.com Date: Thu, 9 Nov 2017 13:33:09 +0900 From: Joonsoo Kim To: Jaewon Kim Cc: Jaewon Kim , Andrew Morton , mhocko@suse.com, vbabka@suse.cz, minchan@kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm: page_ext: allocate page extension though first PFN is invalid Message-ID: <20171109043308.GB24383@js1304-P5Q-DELUXE> References: <20171107094447.14763-1-jaewon31.kim@samsung.com> <20171108075242.GB18747@js1304-P5Q-DELUXE> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 08, 2017 at 10:33:51PM +0900, Jaewon Kim wrote: > 2017-11-08 16:52 GMT+09:00 Joonsoo Kim : > > On Tue, Nov 07, 2017 at 06:44:47PM +0900, Jaewon Kim wrote: > >> online_page_ext and page_ext_init allocate page_ext for each section, but > >> they do not allocate if the first PFN is !pfn_present(pfn) or > >> !pfn_valid(pfn). > >> > >> Though the first page is not valid, page_ext could be useful for other > >> pages in the section. But checking all PFNs in a section may be time > >> consuming job. Let's check each (section count / 16) PFN, then prepare > >> page_ext if any PFN is present or valid. > > > > I guess that this kind of section is not so many. And, this is for > > debugging so completeness would be important. It's better to check > > all pfn in the section. > Thank you for your comment. > > AFAIK physical memory address depends on HW SoC. > Sometimes a SoC remains few GB address region hole between few GB DRAM > and other few GB DRAM > such as 2GB under 4GB address and 2GB beyond 4GB address and holes between them. > If SoC designs so big hole between actual mapping, I thought too much > time will be spent on just checking all the PFNs. I don't think that it is painful because it is done just once at initialization step. However, if you worry about it, we can use pfn_present() to skip the whole section at once. !pfn_present() guarantees that there is no valid pfn in the section. If pfn_present() returns true, we need to search the whole pages in the section in order to find valid pfn. And, I think that we don't need to change online_page_ext(). AFAIK, hotplug always adds section aligned memory so pfn_present() check should be enough. Thanks. From 1583505051914856874@xxx Wed Nov 08 13:34:57 +0000 2017 X-GM-THRID: 1583432714503940064 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread