Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp5371306ybl; Tue, 14 Jan 2020 07:54:01 -0800 (PST) X-Google-Smtp-Source: APXvYqyUOvvUkU+yKfPGNT1rfs8zIBdO5QOsnuCLPXShh84UnUzxsSCjfd7Ry6Alj96uNJ5A+o7b X-Received: by 2002:a05:6830:c2:: with SMTP id x2mr17753868oto.8.1579017241250; Tue, 14 Jan 2020 07:54:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579017241; cv=none; d=google.com; s=arc-20160816; b=kF+K3kQCRmvIYZXcTsnC/QniA90MqGzDRJ8dnhim6azL7ONUKaCq4rWss6tUE73PSd XCsvQseOiQ3ff6gMxxhObZoeZYQx4BXOEwgiHSs7rS4ULEDf1cxu2Xe5kqQ3Xq5Sm+p8 bOddPykagHhmp4R9eum9Ny1AIHbu7tfbhxyOIulbjnHqDli7S+Qcv8aUM02RFupTHvjM srMZRbNwrFwDyxpt/HpCEqXKsNCLNefWfo1kidc2BJL2YJTFOEbumU6zdNo0YCjc0fEZ NXR38Bhq4AUkPtPtpwdQWAgrbBqpXlC2nYVHgpUSwUKVRs8DTFEwbjPuNQcjvcsTMpCd c90g== 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:dkim-signature; bh=zmI+7fCvDJ8jUI/s1LWzV0ABXbMh8NW+HrTxQxtxW+c=; b=x4x37vbC24K+nxrIowlf75GsqXRvpBpjylYz2VZWhLRkHFWDcRKiRYIU5KITeBHS13 26VtuRzIenbqYshNFJTLwHpEq/iqaQiSvTdaVrFAvmmb7IyuOjJwDWnwfw065hZusBSJ UDC1xFgJp3JZehqqUPUMVpObDXb1gKgV0XCGJKAOtjB+Fwo4dy1DvOZLlI5DzGoW7Qs/ KaEPAeFCb3iBx51YSB1BT63WsIJcn+BzJiXiALJo6swRumWefjs5Bgr+mMSKHsVxYK0b 3fhAWc7PyTsb/6hE0pcMh0A4LH0dpQRiSaRRTze3homMDQzJgfGH80cAj1DKn2G1n7Nh HJ5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@shutemov-name.20150623.gappssmtp.com header.s=20150623 header.b=Wm2t8cPh; 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 t12si8567194otm.224.2020.01.14.07.53.49; Tue, 14 Jan 2020 07:54:01 -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=@shutemov-name.20150623.gappssmtp.com header.s=20150623 header.b=Wm2t8cPh; 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 S1727073AbgANPw5 (ORCPT + 99 others); Tue, 14 Jan 2020 10:52:57 -0500 Received: from mail-lf1-f66.google.com ([209.85.167.66]:33804 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726365AbgANPw5 (ORCPT ); Tue, 14 Jan 2020 10:52:57 -0500 Received: by mail-lf1-f66.google.com with SMTP id l18so10217496lfc.1 for ; Tue, 14 Jan 2020 07:52:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shutemov-name.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=zmI+7fCvDJ8jUI/s1LWzV0ABXbMh8NW+HrTxQxtxW+c=; b=Wm2t8cPhYynnALTqITb4PRgUN3xAdtIL/l7NillCbGBQKs9d29OyBpMDhPLuc15IGf Mrkog0biOqCEaTd77ua6TqgU2efNPzr7diD4mLhIaEAlNKTUf70asBLacWTFPtMxcoxN eMS0MmaA5epHFn/XxW+Q4I/ZKoUxE8I1NMoaCo8m/4Do9dOn5ph7E4+xIATrfx66x+hI 9XYQDCGrx3yaP3P4rQhyt/IgawT3rlwBiPrJHHm/SPj7tOXx/Qk3ch9gCT3Yt4sJ68n0 4gwAKa/hwpG3oHP+rCxWWHYpouueIJI5yLV5rhVfs/PEQMqoiGm+OuXyD/3yauzIqK3u Laeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=zmI+7fCvDJ8jUI/s1LWzV0ABXbMh8NW+HrTxQxtxW+c=; b=cOG9MRe7oYfxMzwXeHDDUm9pNsQCAcf3TXjrcCXPxgTvQck62Y3tZ8MDSSeZ/VXzDu gBHNypQBZmSrkKG60CkcaGLVbjbucV8Q9y5SoI7Bz4fxwOpmpUM1pKOfDsdQSRI319h1 DKKyOjl2UJo22MvEeKXmOpAYKNslDy8QrGLEAZ1YYSWze0HSL8IIiJAtkqQ1PrWLBQk0 Rw14dBcfSozkckz9kVM2vaLHrP6dPxs/sx2LB0cJoStmRyERqDNqSPLZMQIxuS586WZZ Mt9iOqMG5KzCQtR9Wjudev1F96mXcODDjHLQXOheXVqg7KFSIr7ze+SdgVe/OH41ByV5 1I1w== X-Gm-Message-State: APjAAAVbTmub4tnraPu029oyRKVbe53UdjbJM3FhzwLJInUQle9Sj4Zf w9Eglrqok5Njh+IsCirlPIhjo143/6Y= X-Received: by 2002:a05:6512:cf:: with SMTP id c15mr2106258lfp.57.1579017175586; Tue, 14 Jan 2020 07:52:55 -0800 (PST) Received: from box.localdomain ([86.57.175.117]) by smtp.gmail.com with ESMTPSA id p15sm7379134lfo.88.2020.01.14.07.52.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jan 2020 07:52:54 -0800 (PST) Received: by box.localdomain (Postfix, from userid 1000) id E23471012B2; Tue, 14 Jan 2020 18:52:58 +0300 (+03) Date: Tue, 14 Jan 2020 18:52:58 +0300 From: "Kirill A. Shutemov" To: David Hildenbrand Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Andrew Morton , Michal Hocko , Oscar Salvador Subject: Re: [PATCH v1 2/2] mm: factor out next_present_section_nr() Message-ID: <20200114155258.kww5ve7agifxxtoy@box> References: <0B77E39C-BD38-4A61-AB28-3578B519952F@redhat.com> <20200114104119.pybggnb4b2mq45wr@box> <4de17591-e2c4-daff-e4b2-d03dd8792d0f@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4de17591-e2c4-daff-e4b2-d03dd8792d0f@redhat.com> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 14, 2020 at 11:49:19AM +0100, David Hildenbrand wrote: > memmap_init_zone() is called for a physical memory region: pfn + size > (nr_pages) > > The highest possible PFN you can have is "-1(unsigned long) >> > PFN_SHIFT". So even if you would want to add the very last section, the > PFN would still be smaller than -1UL << PFN_SECTION_SHIFT. PFN_SHIFT? I guess you mean PAGE_SHIFT. Of course PFN can be more than -1UL >> PAGE_SHIFT. Like on 32-bit x86 with PAE it is ((1ULL << 36) - 1) >> PAGE_SHIFT. That's the whole reason for PAE. The highest possible PFN must fit into phys_addr_t when shifted left by PAGE_SHIFT and must fit into unsigned long. It's can be -1UL if phys_addr_t is 64-bit. Any other limitation I miss? -- Kirill A. Shutemov