Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp5866850ioo; Wed, 1 Jun 2022 14:28:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzsFMSlf9kWK+l+7gY44KzXzTF163PMZfiQv4AcPNmooqXNm6qZL+0OLGXGfEIZOEhKDR/d X-Received: by 2002:a17:90b:4acb:b0:1df:af66:1d2 with SMTP id mh11-20020a17090b4acb00b001dfaf6601d2mr36174486pjb.181.1654118899652; Wed, 01 Jun 2022 14:28:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654118899; cv=none; d=google.com; s=arc-20160816; b=Ae35fL44sbRYvsdxWD8MOgYXrGhuZbeup7iblpHZVnukXQgaIr0I2X46i0hUmZ9uIp hnnPSoMJur6jgky4+FD3gnST6NQC3T22q2U9695L9u2nUClHt9CSrjBcJVT5kKLlCZjv 1bgrfunXO5KYygqVfedMlinN85RMvCOEfchmfJonndXmZg7NfoGqYrRh4JyzuVrSz+tp J5F3NVLIfjEmxGRpDXEnnCwlNkv+0Imc2LK/V1KLJyZpgm+vJaoNQqeRSLLWKo5pRedY qjWwSu4mcAR22jA/GdM7dfxbtjuQh8EvtZEyyUuU2y02adUmmLjvUJQKWdny4j4qzuPL U/uQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=anaEXsXihZfXccuh4VGjrikfVkL3ACbLvXV8Ae5HblE=; b=0tiOa+ane0Vi1oFw4JpoogvVR6QTaqK8anmT+xMAP8RQGXqT2my/yZJERMz/rqA7IU disp9ApKJ9rSpa9DJq0gCFkTW+uI9fXuTZSROGRSXV9M54C+BGinoi0eqfaaReURjUJX JlXL2sIJcvXBvWsoQ/u9y3DFCgwaomS4sarghGDqah9EJeIDewxrbcq/vl10oEJeyYEP yYJjdovANsvUofQ2uU8CqhyHcC/WVPKgKH5K12KRRDvQS1TQKEm2Et9mgoCT6oGlFJDI 9mDAi4sb8JoJmmxH6Qjiryo3jU07stYHPX2q2XJ9k3KEWYNBFd/gGGhvS0eMh9D/aPqN U5OQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id jd7-20020a170903260700b00162188be366si3166171plb.617.2022.06.01.14.28.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 14:28:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 81520311990; Wed, 1 Jun 2022 13:18:29 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234551AbiE3JDY (ORCPT + 99 others); Mon, 30 May 2022 05:03:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37164 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231466AbiE3JDV (ORCPT ); Mon, 30 May 2022 05:03:21 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3E1C314D15 for ; Mon, 30 May 2022 02:03:20 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 05DBC113E; Mon, 30 May 2022 02:03:20 -0700 (PDT) Received: from [10.163.36.153] (unknown [10.163.36.153]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B98243F73D; Mon, 30 May 2022 02:03:17 -0700 (PDT) Message-ID: <6676b6a4-2d2d-27bf-2f71-b0c4767b71bf@arm.com> Date: Mon, 30 May 2022 14:33:18 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH V2] mm/memory_hotplug: Drop 'reason' argument from check_pfn_span() Content-Language: en-US To: David Hildenbrand , linux-mm@kvack.org Cc: Oscar Salvador , Andrew Morton , linux-kernel@vger.kernel.org References: <20220526021258.4030749-1-anshuman.khandual@arm.com> <8c5c5bd6-fea6-4c27-9a84-4b9c937068d7@redhat.com> From: Anshuman Khandual In-Reply-To: <8c5c5bd6-fea6-4c27-9a84-4b9c937068d7@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/30/22 12:24, David Hildenbrand wrote: > On 26.05.22 04:12, Anshuman Khandual wrote: >> In check_pfn_span(), a 'reason' string is being used to recreate the caller >> function name, while printing the warning message. It is really unnecessary >> as the warning message could just be printed inside the caller depending on >> the return code. Currently there are just two callers for check_pfn_span() >> i.e __add_pages() and __remove_pages(). Let's clean this up. >> >> Cc: Oscar Salvador >> Cc: David Hildenbrand >> Cc: Andrew Morton >> Cc: linux-mm@kvack.org >> Cc: linux-kernel@vger.kernel.org >> Signed-off-by: Anshuman Khandual >> --- >> Changes in V2: >> >> - Fixed typo in commit message >> - Dropped using 'ret' to capture check_pfn_span() return value in __add_pages() >> >> Changes in V1: >> >> https://lore.kernel.org/all/20220525033910.3781764-1-anshuman.khandual@arm.com/ >> >> mm/memory_hotplug.c | 20 +++++++++----------- >> 1 file changed, 9 insertions(+), 11 deletions(-) >> >> diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c >> index 416b38ca8def..3b24386e9276 100644 >> --- a/mm/memory_hotplug.c >> +++ b/mm/memory_hotplug.c >> @@ -220,8 +220,7 @@ static void release_memory_resource(struct resource *res) >> kfree(res); >> } >> >> -static int check_pfn_span(unsigned long pfn, unsigned long nr_pages, >> - const char *reason) >> +static int check_pfn_span(unsigned long pfn, unsigned long nr_pages) >> { >> /* >> * Disallow all operations smaller than a sub-section and only >> @@ -238,12 +237,8 @@ static int check_pfn_span(unsigned long pfn, unsigned long nr_pages, >> min_align = PAGES_PER_SUBSECTION; >> else >> min_align = PAGES_PER_SECTION; >> - if (!IS_ALIGNED(pfn, min_align) >> - || !IS_ALIGNED(nr_pages, min_align)) { >> - WARN(1, "Misaligned __%s_pages start: %#lx end: #%lx\n", >> - reason, pfn, pfn + nr_pages - 1); >> + if (!IS_ALIGNED(pfn, min_align) || !IS_ALIGNED(nr_pages, min_align)) > We could do > > if (!IS_ALIGNED(pfn | nr_pages, min_align)) Sure, will change it.