From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9BAEAC33CB3 for ; Tue, 14 Jan 2020 15:52:59 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3D070222C4 for ; Tue, 14 Jan 2020 15:52:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=shutemov-name.20150623.gappssmtp.com header.i=@shutemov-name.20150623.gappssmtp.com header.b="Wm2t8cPh" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3D070222C4 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=shutemov.name Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 9D5968E0005; Tue, 14 Jan 2020 10:52:58 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 95F5C8E0003; Tue, 14 Jan 2020 10:52:58 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 827628E0005; Tue, 14 Jan 2020 10:52:58 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0034.hostedemail.com [216.40.44.34]) by kanga.kvack.org (Postfix) with ESMTP id 640848E0003 for ; Tue, 14 Jan 2020 10:52:58 -0500 (EST) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 321D1180AD820 for ; Tue, 14 Jan 2020 15:52:58 +0000 (UTC) X-FDA: 76376683236.01.cave48_19d4440a68310 X-HE-Tag: cave48_19d4440a68310 X-Filterd-Recvd-Size: 4109 Received: from mail-lf1-f68.google.com (mail-lf1-f68.google.com [209.85.167.68]) by imf06.hostedemail.com (Postfix) with ESMTP for ; Tue, 14 Jan 2020 15:52:57 +0000 (UTC) Received: by mail-lf1-f68.google.com with SMTP id n25so10236539lfl.0 for ; Tue, 14 Jan 2020 07:52:57 -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=fSuLtoNrHwehjOygUrQQYVXX4fQYoLcqSK+d0zZXKMXzUciiAx+RxmXaca7sRqpAUd WZL8idEgVbDq6zG1ruEWfkL+xNoElD/gAE9VB2evfT2nT1pJv6FyMyTMt5drQbxM47Fk bjyR/4uE2jwrsX2umBVHOtxslQzFFh6zPBoRDQ7JkayNnUURQYsO8ZRrdfrn0bFas6tT HywAem80CgmBv8uw5Vr0iYrfdu3KOv+MiRlZ955l3GEZqpABA3Bxo7UtnDJjaV2IR4B4 HrXDtv5pihWbLauq3Y+t+qI7jxLBhBu6UYESU5t0fDlwEHDMuYUsbz9Mh35aW/AH8RZg RyVQ== X-Gm-Message-State: APjAAAVr0vSTUiOq/7N/cjV9Kz4oFtP/u//bt8ixb1TuVYRC1DFiiQxz KYfAqYlVDFYqofqbkeAyrFbt2g== X-Google-Smtp-Source: APXvYqw+3PJvfNkdFH3y9F3CIp1R5dqPceP7RzJP7ftqvhfxkDa2mvUtfpC+UzToTb1sJ6fKFFCIeQ== 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 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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