Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp1477630imj; Fri, 8 Feb 2019 02:04:42 -0800 (PST) X-Google-Smtp-Source: AHgI3IaHJDLumVQh6M6m7Z31nr5bwaw4LbFdP3gDt8GqJX7u4hs9SrW/2Aak5pTuSET38VIZnCVZ X-Received: by 2002:a63:981:: with SMTP id 123mr15009441pgj.444.1549620282443; Fri, 08 Feb 2019 02:04:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549620282; cv=none; d=google.com; s=arc-20160816; b=xx3mU6IDaWZo7y6N1QFZrp+wpULkd2oBEgZAmWwH0kpQvznTUBOPeVxAougR4XWblo K594gTKx934Mrdd1Z4BFE8PYJimqHxAPglH19x4olNO/b6C4UmLu749+6ftC8f9THgvC gl7jPqQQqAPKq0A7ll2fedSuw0NGrHotnV+oBRK8zuFjqD7ZZ6Rj3XusYhqzE7rdYU5a rEgpQEa432lUIkPqfB3aB87Vr+q2Ma9cOCwsWvUsKURBBaef3rzoHFj6OWsz1bLNdbId iZGYFOiuYJo7M14ZqEEy9/bHowwmtitSUNcSjAXCFBV4HHkkD4cWDRIVo6IeP5m+DW+z ZTYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:user-agent:in-reply-to :content-disposition:mime-version:references:subject:cc:to:from:date; bh=utW2vT3KaOmdeS27LLnNSqfihtVuCTya6Q/qp+pT83M=; b=vn4MLEpe+xXzUKqtbYpvFUhH5e0gMtZR6HE4I30tIbLglDij3j0Z9AEaIFi9UOh2o3 b4Yg1Qxides+a/Y9uXsacDAm0RBYrfKpr60+NQO7GB/6rVUxV/LfWN+ig8l85uzrDa5C f/U6VcSKn1du7oOM4+q6eBSi27V3k+422F76Zd+dtFLtmWQtWByKM2imjmi0Y3bIGiOD dOWxejRoK2hP71xdWBOzkE+1P55C0T4bEH+cTMo9+QbIscPKzaw7ltiVkgh08cQsBRzw nWFcATQRuwMTrRe5jKxysX+OgkJl1hdvisopa1BlvJtj4PgF9XKocxljWa0VX9csd9NE Bacg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s11si1620731pgi.324.2019.02.08.02.04.25; Fri, 08 Feb 2019 02:04:42 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727139AbfBHKEM (ORCPT + 99 others); Fri, 8 Feb 2019 05:04:12 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:46050 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726022AbfBHKEL (ORCPT ); Fri, 8 Feb 2019 05:04:11 -0500 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x189wW5W058487 for ; Fri, 8 Feb 2019 05:04:10 -0500 Received: from e06smtp02.uk.ibm.com (e06smtp02.uk.ibm.com [195.75.94.98]) by mx0a-001b2d01.pphosted.com with ESMTP id 2qh4xe7fd9-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 08 Feb 2019 05:04:10 -0500 Received: from localhost by e06smtp02.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 8 Feb 2019 10:04:08 -0000 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp02.uk.ibm.com (192.168.101.132) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Fri, 8 Feb 2019 10:04:04 -0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x18A44L361604062 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 8 Feb 2019 10:04:04 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id F0F64A405D; Fri, 8 Feb 2019 10:04:03 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5F448A4055; Fri, 8 Feb 2019 10:04:03 +0000 (GMT) Received: from rapoport-lnx (unknown [9.148.205.183]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Fri, 8 Feb 2019 10:04:03 +0000 (GMT) Date: Fri, 8 Feb 2019 12:04:01 +0200 From: Mike Rapoport To: Souptick Joarder Cc: Andrew Morton , Michal Hocko , Linux-MM , linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] memblock: remove memblock_{set,clear}_region_flags References: <1549455025-17706-1-git-send-email-rppt@linux.ibm.com> <1549455025-17706-2-git-send-email-rppt@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-TM-AS-GCONF: 00 x-cbid: 19020810-0008-0000-0000-000002BE009E X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19020810-0009-0000-0000-0000222A0E13 Message-Id: <20190208100401.GB11096@rapoport-lnx> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-02-08_06:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1902080072 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 07, 2019 at 10:02:24PM +0530, Souptick Joarder wrote: > 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 ? I prefer using a local variable to type->regions[i].flags > > + > > 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 > > > -- Sincerely yours, Mike.