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.5 required=3.0 tests=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 B6D9DC433FF for ; Wed, 14 Aug 2019 16:02:24 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7C2D52083B for ; Wed, 14 Aug 2019 16:02:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7C2D52083B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 25A3B6B0006; Wed, 14 Aug 2019 12:02:24 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 20B7D6B0007; Wed, 14 Aug 2019 12:02:24 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0FA6E6B000A; Wed, 14 Aug 2019 12:02:24 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0077.hostedemail.com [216.40.44.77]) by kanga.kvack.org (Postfix) with ESMTP id E3FF36B0006 for ; Wed, 14 Aug 2019 12:02:23 -0400 (EDT) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with SMTP id 85E8E8248AA5 for ; Wed, 14 Aug 2019 16:02:23 +0000 (UTC) X-FDA: 75821500566.01.glue09_4f00bda296400 X-HE-Tag: glue09_4f00bda296400 X-Filterd-Recvd-Size: 2712 Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) by imf17.hostedemail.com (Postfix) with ESMTP for ; Wed, 14 Aug 2019 16:02:22 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 3449DADE6; Wed, 14 Aug 2019 16:02:21 +0000 (UTC) Date: Wed, 14 Aug 2019 18:02:20 +0200 From: Michal Hocko To: David Hildenbrand Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Arun KS , Andrew Morton , Oscar Salvador , Pavel Tatashin , Dan Williams Subject: Re: [PATCH v1 2/4] mm/memory_hotplug: Handle unaligned start and nr_pages in online_pages_blocks() Message-ID: <20190814160220.GF17933@dhcp22.suse.cz> References: <20190809125701.3316-1-david@redhat.com> <20190809125701.3316-3-david@redhat.com> <20190814140805.GA17933@dhcp22.suse.cz> <8d1ba12d-9993-1822-38e4-422a46108fec@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8d1ba12d-9993-1822-38e4-422a46108fec@redhat.com> User-Agent: Mutt/1.10.1 (2018-07-13) 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 Wed 14-08-19 16:28:21, David Hildenbrand wrote: > On 14.08.19 16:17, David Hildenbrand wrote: > > On 14.08.19 16:08, Michal Hocko wrote: > >> On Fri 09-08-19 14:56:59, David Hildenbrand wrote: > >>> Take care of nr_pages not being a power of two and start not being > >>> properly aligned. Essentially, what walk_system_ram_range() could provide > >>> to us. get_order() will round-up in case it's not a power of two. > >>> > >>> This should only apply to memory blocks that contain strange memory > >>> resources (especially with holes), not to ordinary DIMMs. > >> > >> I would really like to see an example of such setup before making the > >> code hard to read. Because I am not really sure something like that > >> exists at all. > > > > I don't have a real-live example at hand (founds this while exploring > > the code), however, the linked commit changed it without stating why it > > would be safe to do so. > > So, while I agree that "not a power of two" is rare, are you sure we > will only have holes that are aligned to 4MB (especially on x86)? No I am not saying that because I do not know. I am not aware of any such HW but that doesn't really mean anything. But I would like to see an example and have it archived in the changelog before we make the code more complicated. -- Michal Hocko SUSE Labs