Received: by 10.223.164.202 with SMTP id h10csp551049wrb; Tue, 7 Nov 2017 10:25:11 -0800 (PST) X-Google-Smtp-Source: ABhQp+RBSar7r24t5dyq3VnZTeLNx+GmD8J+kRcpO3bMvP2CBbbX3kCeVCGfjt1tI0X1z8onnEny X-Received: by 10.159.218.73 with SMTP id x9mr12129580plv.259.1510079111669; Tue, 07 Nov 2017 10:25:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510079111; cv=none; d=google.com; s=arc-20160816; b=vNqQ63cZGxegKQDezl+XuRsqKgsuNpJ2i5SDka9adnrQuAgq1EAGoxQX8jS429Tln+ vIvVjFpU9pHEP8ET2bxPLQuvDY50zYcwYtSPeYXTH3A6JxV8qM2ZRKqY4NsXAesMpNj+ nxDRD9FG7rXMySvLPADVaxi16cq8IOGEIjzGytk7oKlceKFrWDRhhAsbL4GMbRN58UCw 9HWjOvy9OmdynvvT8OIGzQIV6CbcUPRBX7ZGSbhsSeySQieDCVQ20754kTQgp80gc2Ab Ekj0CC28/7YEdZJIr3Ub6O9jEUwMu6iFVqetDaD3gRVZAtrDDsoBZ7JRga6C8+3yU9sJ xb2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:dlp-filter:cms-type:message-id :date:subject:cc:to:from:dkim-signature:dkim-filter :arc-authentication-results; bh=4vrh3lKedxbUtL2blkvT/N5MXdf1IZ+k2iH9Dt8/nic=; b=MAgegVOlLo4ijkqy17OxJGNpuhALPe3UlgK5CzNX3wFUTMIER/SHBsVaDcWIoPN+sz TfEm8Jcs5mclYCJzsZr/uDH2VvXWDG8y3lGrdez2SCTVo5n9QdY++GmeiwddF3gJvgve 65lW0kO0jJ4C2ptvGBZyOF2kKvU81JoIiJ+mF/QZpAYFYLsurINIRoOcjamccLNqF45B 2Ykzp4POgEYYkDexkM/wLA1MyPm6ACf2wp17zktc5m+fbksEELGg6UUMyfNOwHyFYh/R iBwotppNPsPZ6auAtJgCOAtAmZ7Ox5R8o18+TIdB8ORvAomXEheKsmHIZ1nMmw77duFg JbTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=awQV6VcO; 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=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f126si1939621pfg.410.2017.11.07.10.24.58; Tue, 07 Nov 2017 10:25:11 -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; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=awQV6VcO; 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=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933677AbdKGJnT (ORCPT + 91 others); Tue, 7 Nov 2017 04:43:19 -0500 Received: from mailout3.samsung.com ([203.254.224.33]:11886 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933592AbdKGJnO (ORCPT ); Tue, 7 Nov 2017 04:43:14 -0500 Received: from epcas1p1.samsung.com (unknown [182.195.41.45]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20171107094312epoutp037c61574d867c49c0c0fd72eb183daf7e~0xHdrHwG33002730027epoutp03B; Tue, 7 Nov 2017 09:43:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20171107094312epoutp037c61574d867c49c0c0fd72eb183daf7e~0xHdrHwG33002730027epoutp03B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1510047792; bh=4vrh3lKedxbUtL2blkvT/N5MXdf1IZ+k2iH9Dt8/nic=; h=From:To:Cc:Subject:Date:References:From; b=awQV6VcOOUliXhp0oIN0HrYyeimIzv6f9xTOgJifZCZnQ765UClzPrlaA+WOEGzad K0EtF4+iA/TLMb6soO8r5z4SvvOrbu646DHx5zPLVyN8n3tfc4uqIJfXyADdJzdVmZ gyOc0byMH+uA6Urao69cS17fKSgYcgBIB5Fwj3l8= Received: from epsmges1p2.samsung.com (unknown [182.195.40.93]) by epcas1p4.samsung.com (KnoxPortal) with ESMTP id 20171107094312epcas1p4f807e8e617dd50ffa2da8fd62df094ba~0xHdd2oCs3012930129epcas1p4z; Tue, 7 Nov 2017 09:43:12 +0000 (GMT) Received: from epcas1p1.samsung.com ( [182.195.41.45]) by epsmges1p2.samsung.com (Symantec Messaging Gateway) with SMTP id 26.ED.04153.F20810A5; Tue, 7 Nov 2017 18:43:11 +0900 (KST) Received: from epsmgms2p1new.samsung.com (unknown [182.195.42.142]) by epcas1p4.samsung.com (KnoxPortal) with ESMTP id 20171107094311epcas1p4a5dd975d6e9f3618a26a0a5d68c68b55~0xHdH2BwV2317723177epcas1p4u; Tue, 7 Nov 2017 09:43:11 +0000 (GMT) X-AuditID: b6c32a36-33dff70000001039-1d-5a01802f6b84 Received: from epmmp2 ( [203.254.227.17]) by epsmgms2p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 0F.DE.04095.F20810A5; Tue, 7 Nov 2017 18:43:11 +0900 (KST) Received: from jaewon-linux.165.213.246.161 ([10.253.100.37]) by mmp2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OZ100LZXKBX5450@mmp2.samsung.com>; Tue, 07 Nov 2017 18:43:11 +0900 (KST) From: Jaewon Kim To: akpm@linux-foundation.org Cc: mhocko@suse.com, vbabka@suse.cz, minchan@kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, jaewon31.kim@gmail.com, Jaewon Kim Subject: [PATCH] mm: page_ext: allocate page extension though first PFN is invalid Date: Tue, 07 Nov 2017 18:44:47 +0900 Message-id: <20171107094447.14763-1-jaewon31.kim@samsung.com> X-Mailer: git-send-email 2.13.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrHKsWRmVeSWpSXmKPExsWy7bCmrq5+A2OUwaJGK4s569ewWXRvnslo 0fv+FZPF5V1z2CzurfnPanG/z8Fi2df37BazG/sYHTg8ds66y+6xaVUnm8emT5PYPU7M+M3i 0bdlFaPH+i1XWTzOLDjC7vF5k1wAR1SqTUZqYkpqkUJqXnJ+SmZeuq2Sd3C8c7ypmYGhrqGl hbmSQl5ibqqtkotPgK5bZg7QZUoKZYk5pUChgMTiYiV9O5ui/NKSVIWM/OISW6VoQ0MjPUMD cz0jIyM9E/NYKyNToJKE1IzDDUvZCq7wVsw4P52lgXEHVxcjJ4eEgInEmQerGUFsIYEdjBIT Vxd2MXIB2d8ZJc5MmsgKU9Qz5TQ7RGIDo8Sa6y9ZIJz/jBJfj81lB6liE9CWeL9gEliHiICs xNS/58GKmAXWMEo82f0ILCEsECIxZ+10FhCbRUBVYv+5JrYuRg4OXgFbiQ0fIyC2yUtc+dUP 1ishMIFNYvKvi0wQCReJCQenskHYwhKvjm9hB+mVEJCWuHTUFqK+m1GiZ+N6qPoOIOdBJoRt LPHp82ewP5kF+CTefe1hhejllehoE4Io8ZC4297MDmE7Siy/18QCCZZYiad9x1gmMEouYGRY xSiWWlCcm55abFhgpFecmFtcmpeul5yfu4kRnFa0zHYwLjrnc4hRgINRiYd3xkGGKCHWxLLi ytxDjBIczEoivNvVgUK8KYmVValF+fFFpTmpxYcYTYGhMZFZSjQ5H5jy8kriDU0sDUzMjExN DQ0sTJTEeUXXX4sQEkhPLEnNTk0tSC2C6WPi4JRqYJw9bZ3oJ5nn67f/ad5Uy34z+NKkVEbN ZRcyZp4r/Lp4/iSDyWcuT3E/YHPyoU79vjtcIdO/5/bNTv4rWTw/6coWrZI9V6f+yr26/lHm 85/MWpxHa9XrWTu/1sodOPmV54wU/55HiS4LTp7+oWD0ZKGLe4x0sULSi5KUmN/a8527mSdc LhGt6GBSYinOSDTUYi4qTgQAX/MT5kEDAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpnluLIzCtJLcpLzFFi42I5/e+xoK5+A2OUwY5uVYs569ewWXRvnslo 0fv+FZPF5V1z2CzurfnPanG/z8Fi2df37BazG/sYHTg8ds66y+6xaVUnm8emT5PYPU7M+M3i 0bdlFaPH+i1XWTzOLDjC7vF5k1wARxSXTUpqTmZZapG+XQJXxuGGpWwFV3grZpyfztLAuIOr i5GTQ0LARKJnymn2LkYuDiGBdYwSM2YcZINwGpkkWt7NZgOpYhPQlni/YBIriC0iICsx9e95 FpAiZoE1jBLzG+4ygSSEBUIk5qydzgJiswioSuw/1wTUzMHBK2ArseFjBMQ2eYkrv/pZJjBy LWBkWMUomVpQnJueW2xUYJiXWq5XnJhbXJqXrpecn7uJERg82w5r9e1gvL8k/hCjAAejEg/v jIMMUUKsiWXFlbmHGCU4mJVEeLerA4V4UxIrq1KL8uOLSnNSiw8xSnOwKInz3s47FikkkJ5Y kpqdmlqQWgSTZeLglGpg9N9skc47V/+0slOI/rxFm/Key2T29l7Wqty0QveJ88tqvrY3ErEB hm9mbYr5dcH/5VsN38rGULOHr0+eWxi9cKdXvkHL9SVsevoHuTm4r5ZmTdXyEl++midRv1SY Y7VPzor1O2P7vDjO/hKQFAkViVjZdGDneeNfb88oT89cfvRjwxH/re9NlFiKMxINtZiLihMB Xtc22xoCAAA= X-CMS-MailID: 20171107094311epcas1p4a5dd975d6e9f3618a26a0a5d68c68b55 X-Msg-Generator: CA CMS-TYPE: 101P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20171107094311epcas1p4a5dd975d6e9f3618a26a0a5d68c68b55 X-RootMTR: 20171107094311epcas1p4a5dd975d6e9f3618a26a0a5d68c68b55 References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Signed-off-by: Jaewon Kim --- mm/page_ext.c | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/mm/page_ext.c b/mm/page_ext.c index 32f18911deda..634f9c5a8b9b 100644 --- a/mm/page_ext.c +++ b/mm/page_ext.c @@ -312,7 +312,17 @@ static int __meminit online_page_ext(unsigned long start_pfn, } for (pfn = start; !fail && pfn < end; pfn += PAGES_PER_SECTION) { - if (!pfn_present(pfn)) + unsigned long t_pfn = pfn; + bool present = false; + + while (t_pfn < ALIGN(pfn + 1, PAGES_PER_SECTION)) { + if (pfn_present(t_pfn)) { + present = true; + break; + } + t_pfn = ALIGN(pfn + 1, PAGES_PER_SECTION >> 4); + } + if (!present) continue; fail = init_section_page_ext(pfn, nid); } @@ -391,8 +401,17 @@ void __init page_ext_init(void) */ for (pfn = start_pfn; pfn < end_pfn; pfn = ALIGN(pfn + 1, PAGES_PER_SECTION)) { - - if (!pfn_valid(pfn)) + unsigned long t_pfn = pfn; + bool valid = false; + + while (t_pfn < ALIGN(pfn + 1, PAGES_PER_SECTION)) { + if (pfn_valid(t_pfn)) { + valid = true; + break; + } + t_pfn = ALIGN(pfn + 1, PAGES_PER_SECTION >> 4); + } + if (!valid) continue; /* * Nodes's pfns can be overlapping. -- 2.13.0 From 1583538917755781963@xxx Wed Nov 08 22:33:14 +0000 2017 X-GM-THRID: 1583538917755781963 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread