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 6299FC43603 for ; Wed, 11 Dec 2019 08:37:50 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2C9032077B for ; Wed, 11 Dec 2019 08:37:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2C9032077B 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 B6E706B3100; Wed, 11 Dec 2019 03:37:49 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id B1F846B3101; Wed, 11 Dec 2019 03:37:49 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A0D2C6B3102; Wed, 11 Dec 2019 03:37:49 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0218.hostedemail.com [216.40.44.218]) by kanga.kvack.org (Postfix) with ESMTP id 871B26B3100 for ; Wed, 11 Dec 2019 03:37:49 -0500 (EST) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with SMTP id 19E541EF0 for ; Wed, 11 Dec 2019 08:37:49 +0000 (UTC) X-FDA: 76252207458.14.women43_443281b7d6f50 X-HE-Tag: women43_443281b7d6f50 X-Filterd-Recvd-Size: 4664 Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by imf23.hostedemail.com (Postfix) with ESMTP for ; Wed, 11 Dec 2019 08:37:48 +0000 (UTC) Received: by mail-wm1-f67.google.com with SMTP id p9so6059754wmc.2 for ; Wed, 11 Dec 2019 00:37:48 -0800 (PST) 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=RT9pTTqiwT2L0hZKyzfnOGnReyBEaT0I8SJou9/ZWtA=; b=Zoxhgn9Pdg5XMmSq3+GUdpz0V5pRxTapX7gxbsbeJuob01J8rSvNSRKGl8lrWD0H2a DvrDq0O+QkELuTjLxAGiAPsBjBhiCnnROhxH/MeJoDGI6WXTLMvTr6Nk84FjDqV+gSLa ClbtrHMoCqvPfD+zcDxopeH04MwYfd4XceRJO2AOZCaxA4llQHS4s5W1cro5NETKe6iB Np1O/VBT1KLB7CKUKsnrsW1lxZ0rK4rv/wwiB8debJ95bFQojj/DxGTJOKgrcEkl01Da 25A4Bw7PfebjIrSfYHcQMv7V9CWgyURv9r3b83wzL9ZUlgGLASWfT/8vYso53BJuYaGs GX6A== X-Gm-Message-State: APjAAAXphdYZTClC/lEdJ2JXPE0gEJTgXb1BR+QSDSXuFNzWhyd2gUJd 4PD6aJ9oY71/ipRLU8YmNak= X-Google-Smtp-Source: APXvYqw61QRsYL0Lq+p6xXB8wylpboyl1Ts6lCVX0L7iemSth1vHmOlbDD2iTtXwvmvWkyZL3xVJiQ== X-Received: by 2002:a7b:cf18:: with SMTP id l24mr2029460wmg.95.1576053467280; Wed, 11 Dec 2019 00:37:47 -0800 (PST) Received: from localhost (prg-ext-pat.suse.com. [213.151.95.130]) by smtp.gmail.com with ESMTPSA id f1sm1406269wrp.93.2019.12.11.00.37.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Dec 2019 00:37:46 -0800 (PST) Date: Wed, 11 Dec 2019 09:37:45 +0100 From: Michal Hocko To: Logan Gunthorpe Cc: David Hildenbrand , Dan Williams , Linux Kernel Mailing List , Linux ARM , linux-ia64@vger.kernel.org, linuxppc-dev , linux-s390 , Linux-sh , platform-driver-x86@vger.kernel.org, Linux MM , Christoph Hellwig , Andrew Morton , Catalin Marinas , Will Deacon , Benjamin Herrenschmidt , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , Andy Lutomirski , Peter Zijlstra Subject: Re: [PATCH 5/6] mm, memory_hotplug: Provide argument for the pgprot_t in arch_add_memory() Message-ID: <20191211083745.GA14655@dhcp22.suse.cz> References: <20191209191346.5197-1-logang@deltatee.com> <20191209191346.5197-6-logang@deltatee.com> <20191210100432.GC10404@dhcp22.suse.cz> <6da2b279-6a6d-d89c-a34c-962ed021d91d@redhat.com> <20191210103452.GF10404@dhcp22.suse.cz> <297b7cc0-c5bc-a4c6-83eb-afc008395234@deltatee.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <297b7cc0-c5bc-a4c6-83eb-afc008395234@deltatee.com> User-Agent: Mutt/1.12.2 (2019-09-21) 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 10-12-19 16:52:31, Logan Gunthorpe wrote: [...] > In my opinion, having a coder and reviewer see PAGE_KERNEL and ask if > that makes sense is a benefit. Having it hidden because we don't want > people to think about it is worse, harder to understand and results in > bugs that are more difficult to spot. My experience would disagree here. We have several examples in the MM where an overly complex and versatile APIs led to suble bugs, a lot of copy&pasting and cargo cult programing (just look at the page allocator as a shiny example - e.g. gfp_flags). So I am always trying to be carefull here. > Though, we may be overthinking this: arch_add_memory() is a low level > non-exported API that's currently used in exactly two places. This is a fair argument. Most users are and should be using add_memory(). > I don't > think there's going to be many, if any, valid new use cases coming up > for it in the future. That's more what memremap_pages() is for. OK, fair enough. If this is indeed the simplest way forward then I will not stand in the way. -- Michal Hocko SUSE Labs