Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp564893imj; Thu, 7 Feb 2019 08:28:53 -0800 (PST) X-Google-Smtp-Source: AHgI3IYrF0i5B+O0139valy/EA9zov9MKVJqunPkUngUtEk01VN09mlLBaVOkucsz0mnV0Zaz1HP X-Received: by 2002:a62:a1a:: with SMTP id s26mr17042815pfi.31.1549556932919; Thu, 07 Feb 2019 08:28:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549556932; cv=none; d=google.com; s=arc-20160816; b=qKAVpy89a4cJ9dbhX9JLstRbSMWM8e9rkVeRotdLzFpnW46NHFZ+IcQW+eVF1hZJW2 Mh9ETnX0f1FGOBgRq5DM34TVnBgXGoDNHCim8aHxpRqnwsgfLt9qNY5NdjFDHQ3fD4MG Jqkr3c4dbYG+ErQL+mvA5Eznl1NusiKmY0Dg0w8qHz7OKHCUoOtCocaFUmiGPN+X5Y4r cMQNy2Ysc7RJ3EN6w1v3ZZ8fGeKbKwIR7Z09d3tQmQkqRcUYJ5MaRppKX+LIT2mfO52R 83SvfQKJhl67fjPsi00L3dzT19AC2ImOo9OgTkFgZwuxgVPtCDp7vHzLhg60gyW+BY8g l+Zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=NqcbSbVgDZtdgzYO2knt/tKwP8VpBZkOZlHZOIDOo1c=; b=yHXhjW1PR1jzMQDuiQsi5Pvx0QCyeOpgbW9I7+KnEal2cE2NVENhrJ1H24WiMr6FNi f5Ibv7ie4WqaCU+D37NDm+dMOn0Tr56tHVXOKOqIm3VgTiztCa5zOR0RnI9H8ML4DyXr 9isztiIxz5KoeVkE2uMc5kwHEEtfe8lpqA1WgHE9XuuEg+WvMgTMSIz0fmShLxPK/7m5 Ky1lJkWtLeiiSiS5ghVT57GlwyBWOMXGY/DSHlZIpGAjTU3uJfJc25F/MXw9kkWBLnmc NzWz/L47B3yR8/eVBfV7ATbJHE5xVgF4uepAhCdG6wACk7VQpFovB5XBdG2Ld4hvRS0N GQBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=sdsIfMHX; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w6si944062pfb.191.2019.02.07.08.28.36; Thu, 07 Feb 2019 08:28:52 -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=@gmail.com header.s=20161025 header.b=sdsIfMHX; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726775AbfBGQ2T (ORCPT + 99 others); Thu, 7 Feb 2019 11:28:19 -0500 Received: from mail-lf1-f67.google.com ([209.85.167.67]:44872 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726319AbfBGQ2S (ORCPT ); Thu, 7 Feb 2019 11:28:18 -0500 Received: by mail-lf1-f67.google.com with SMTP id z13so306869lfe.11 for ; Thu, 07 Feb 2019 08:28:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=NqcbSbVgDZtdgzYO2knt/tKwP8VpBZkOZlHZOIDOo1c=; b=sdsIfMHX6Hcka/qDE5Of4d5cYBnxOvraEFktqyRV/YqTIWmQsIImsZno3PQ3QXvChB Ih/lmi/xTQFFrMYlVw+S5XdPaTbtcdmJaI8T0TFfT7FjDEziF0CZBWusxURwBejpR0jo m17dh++ITWi1D5YnoDzkhxCwirtKtc6fisRf2hCqOBX+sgVz9neLdgyiHyHI4CQTE13q PuM67m2S0tSrsluLr/a5PN8VAlpJogm75t4FDAnhA8rZWD74jixsMvIjJLbLh3g6E3h8 K6Eit5WubNjI0TfJ2ZFvGFVh5O2GekVAEB39bM78hq6gAe2q7LM58untWC3Km79KRHm5 2PIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=NqcbSbVgDZtdgzYO2knt/tKwP8VpBZkOZlHZOIDOo1c=; b=jDgjy7pb9MNBPerAScwhoBdEaoP0cyn98POHMVaSeQjhxVNelPiWqwxc/G5idp6qb7 CCeRGhyTPdl/5PwPQ4YAmO2Z2zwY8jwXrSSPD8NKSU6y1nNetfBDS4QvrU1H53FtplU/ DIjRHwv3WsSp1UAaH+gCB5yeVNwFOZxlyCBmjbSr+FTT/ml9+7M18G2NjM99ypT2bvZT NNynda7s+S3A2v61RxQwr1hTntX2Kns0I1vNy3vvrViv+EJsVDuqjJXODjWTzKYdjURx 48Tzi8QnNBnVw6CDVNeWTT8ekylUUiBmYei+W65XrMcMo9HLiQY/KPQqT777mJdvfbm3 4GsA== X-Gm-Message-State: AHQUAuZH+qzsd+NwMyrYZWi7s82L1ThaAYAMV82VIneKTLG6fnHD+xAB lXLxiEhebwNW9+e8alSIiepr2Qs8OcsNoAtJBXc= X-Received: by 2002:a19:6514:: with SMTP id z20mr10885979lfb.31.1549556896462; Thu, 07 Feb 2019 08:28:16 -0800 (PST) MIME-Version: 1.0 References: <1549455025-17706-1-git-send-email-rppt@linux.ibm.com> <1549455025-17706-2-git-send-email-rppt@linux.ibm.com> In-Reply-To: <1549455025-17706-2-git-send-email-rppt@linux.ibm.com> From: Souptick Joarder Date: Thu, 7 Feb 2019 22:02:24 +0530 Message-ID: Subject: Re: [PATCH 1/2] memblock: remove memblock_{set,clear}_region_flags To: Mike Rapoport Cc: Andrew Morton , Michal Hocko , Linux-MM , linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 6, 2019 at 6:01 PM Mike Rapoport wrote: > > The memblock API provides dedicated helpers to set or clear a flag on a > memory region, e.g. memblock_{mark,clear}_hotplug(). > > The memblock_{set,clear}_region_flags() functions are used only by the > memblock internal function that adjusts the region flags. > Drop these functions and use open-coded implementation instead. > > Signed-off-by: Mike Rapoport > --- > include/linux/memblock.h | 12 ------------ > mm/memblock.c | 9 ++++++--- > 2 files changed, 6 insertions(+), 15 deletions(-) > > diff --git a/include/linux/memblock.h b/include/linux/memblock.h > index 71c9e32..32a9a6b 100644 > --- a/include/linux/memblock.h > +++ b/include/linux/memblock.h > @@ -317,18 +317,6 @@ void __next_mem_pfn_range_in_zone(u64 *idx, struct zone *zone, > for_each_mem_range_rev(i, &memblock.memory, &memblock.reserved, \ > nid, flags, p_start, p_end, p_nid) > > -static inline void memblock_set_region_flags(struct memblock_region *r, > - enum memblock_flags flags) > -{ > - r->flags |= flags; > -} > - > -static inline void memblock_clear_region_flags(struct memblock_region *r, > - enum memblock_flags flags) > -{ > - r->flags &= ~flags; > -} > - > #ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP > int memblock_set_node(phys_addr_t base, phys_addr_t size, > struct memblock_type *type, int nid); > diff --git a/mm/memblock.c b/mm/memblock.c > index 0151a5b..af5fe8e 100644 > --- a/mm/memblock.c > +++ b/mm/memblock.c > @@ -851,11 +851,14 @@ static int __init_memblock memblock_setclr_flag(phys_addr_t base, > if (ret) > return ret; > > - for (i = start_rgn; i < end_rgn; i++) > + for (i = start_rgn; i < end_rgn; i++) { > + struct memblock_region *r = &type->regions[i]; Is it fine if we drop this memblock_region *r altogether ? > + > if (set) > - memblock_set_region_flags(&type->regions[i], flag); > + r->flags |= flag; > else > - memblock_clear_region_flags(&type->regions[i], flag); > + r->flags &= ~flag; > + } > > memblock_merge_regions(type); > return 0; > -- > 2.7.4 >