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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 47420ECAAA1 for ; Fri, 9 Sep 2022 11:35:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D7A2D8D0003; Fri, 9 Sep 2022 07:35:05 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D2AB98D0002; Fri, 9 Sep 2022 07:35:05 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BCAF28D0003; Fri, 9 Sep 2022 07:35:05 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id AB8B28D0002 for ; Fri, 9 Sep 2022 07:35:05 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 87D41141338 for ; Fri, 9 Sep 2022 11:35:05 +0000 (UTC) X-FDA: 79892340570.15.46B54A5 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf23.hostedemail.com (Postfix) with ESMTP id 267E714008E for ; Fri, 9 Sep 2022 11:35:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1662723304; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=D71aNJwUf2Cj4QI1/Yh0CfylC8ya9cAVpDQe3Gn0t0U=; b=h8Ef/GlC+nSrQKt8JB+/SIwnHt6IKU/RzmKciYm5MXqTdHlvpBPLA1A6j7eOQ7kD6/IaGP Aqa4uLRoMCDdS/FI/NTQTH/K3etMbFOgfAxi5NZI4yOIeXHydT4fPaJ7+OmrMhuDCcMuWC E1jdK/JIh5SQWKraFcdcBAtv4q5eSYw= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-413-3D3eXiTzN8WK5fSFD8WxQg-1; Fri, 09 Sep 2022 07:35:03 -0400 X-MC-Unique: 3D3eXiTzN8WK5fSFD8WxQg-1 Received: by mail-wm1-f69.google.com with SMTP id r128-20020a1c4486000000b003b3f017f259so726430wma.3 for ; Fri, 09 Sep 2022 04:35:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date; bh=D71aNJwUf2Cj4QI1/Yh0CfylC8ya9cAVpDQe3Gn0t0U=; b=HSD2Z6qXKy5fkn30ibar8Kjc2dxnaj5CFu6QPKKf1k1jM9nhlYAkolRPJcUtT/G+bm 67wURMhGkzYKxk+eUgGhl9qs82SG5gg3rq0Kuk/Flq4QoQvjJa7M0sZnDvPMlsk+HXnn Nq9d28lO4N+LZNZMWkuo+vzqu/HTBaqsA6Dj8HQ3PwYR6cU9Jsscq46lDUtL6Ufow7fy y/vcnbMYHegDhdEj35yLDQJJT9uMbjQ+71EWo/gmf8CPTgOkSS5BrwzWR3P+QFeCDkB8 S4bXWgc5W2Pj9plXjdn47cn5q1PaCI1H5v9VC4GqASaPJy/A7IpVN4AksI2lB6Pz1BLC sR3g== X-Gm-Message-State: ACgBeo0VWAU6eOBCeLy6SrAodfqRR+1LEZJlVhK99ApqwikolMADfJtV bBcAIIQFkf3yrhKZknD7Ltu6B9BDQ83b0APfyEZAC2q5mjJIiEJ9HEc2elYKo8F0FMXzocLwkJY TC/uOPwqi5lI= X-Received: by 2002:a7b:c016:0:b0:3a5:fff2:62f4 with SMTP id c22-20020a7bc016000000b003a5fff262f4mr5408584wmb.104.1662723302376; Fri, 09 Sep 2022 04:35:02 -0700 (PDT) X-Google-Smtp-Source: AA6agR7AB3xHdA3oy9QrqeLron6tO5huUdFpE1KVoEoG2zOSPQ+PqLdhNehQpCIw1kmBkg1i82LMZA== X-Received: by 2002:a7b:c016:0:b0:3a5:fff2:62f4 with SMTP id c22-20020a7bc016000000b003a5fff262f4mr5408562wmb.104.1662723302069; Fri, 09 Sep 2022 04:35:02 -0700 (PDT) Received: from ?IPV6:2003:cb:c704:6300:1fe0:42e1:62c5:91b6? (p200300cbc70463001fe042e162c591b6.dip0.t-ipconnect.de. [2003:cb:c704:6300:1fe0:42e1:62c5:91b6]) by smtp.gmail.com with ESMTPSA id i15-20020a1c540f000000b003a32251c3f9sm426510wmb.5.2022.09.09.04.35.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 09 Sep 2022 04:35:01 -0700 (PDT) Message-ID: Date: Fri, 9 Sep 2022 13:34:52 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.0 Subject: Re: [PATCH 12/16] mm/page_alloc: use helper macro SZ_1{K,M} To: Miaohe Lin , akpm@linux-foundation.org Cc: osalvador@suse.de, linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20220909092451.24883-1-linmiaohe@huawei.com> <20220909092451.24883-13-linmiaohe@huawei.com> From: David Hildenbrand Organization: Red Hat In-Reply-To: <20220909092451.24883-13-linmiaohe@huawei.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662723305; a=rsa-sha256; cv=none; b=ISJdDY6LcmdaaUivcJQjMic/x2ofylCjWUSAhkk9N3sfgbqj6NhPINtGxvHsN9/leXw7FM bTsO67qnHKsBr07B3R8Vi1SGjUw9rLu99SMBJslqQyrgbEC4Be5qVzdOz9Aky+ABl+ac86 hQw0Z4xNpNuMvmqbbztDvyykNLdTBy8= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="h8Ef/GlC"; spf=pass (imf23.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662723305; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=D71aNJwUf2Cj4QI1/Yh0CfylC8ya9cAVpDQe3Gn0t0U=; b=2AeoWQfdYDmNhHI6jdQRzhLNy2ESDPX88SmtoDlW6H2mJxdWCTyFxhRw94C2BmFndAuFUz Ln7ShnpyW1pnbll7ZsCsuXYvI+LZgOtgUvAcy9wQ615nhKsJp1RLAI8OlZMoHk5ze2WXYO fcGdVZxC9Vw6tK5FPk+xLDXhOnhS1gk= X-Stat-Signature: dowq14q3tdxx63hc1oea98fbxrops5iy X-Rspam-User: X-Rspamd-Queue-Id: 267E714008E X-Rspamd-Server: rspam07 Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="h8Ef/GlC"; spf=pass (imf23.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-HE-Tag: 1662723304-966694 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 09.09.22 11:24, Miaohe Lin wrote: > Use helper macro SZ_1K and SZ_1M to do the size conversion. Minor > readability improvement. > > Signed-off-by: Miaohe Lin > --- > mm/page_alloc.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > index 7a8a6bb08a15..e1c7f98cff96 100644 > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -7053,7 +7053,7 @@ static int zone_batchsize(struct zone *zone) > * size is striking a balance between allocation latency > * and zone lock contention. > */ > - batch = min(zone_managed_pages(zone) >> 10, (1024 * 1024) / PAGE_SIZE); > + batch = min(zone_managed_pages(zone) >> 10, SZ_1M / PAGE_SIZE); > batch /= 4; /* We effectively *= 4 below */ > if (batch < 1) > batch = 1; > @@ -8528,8 +8528,8 @@ void __init mem_init_print_info(void) > #endif > ")\n", > K(nr_free_pages()), K(physpages), > - codesize >> 10, datasize >> 10, rosize >> 10, > - (init_data_size + init_code_size) >> 10, bss_size >> 10, > + codesize / SZ_1K, datasize / SZ_1K, rosize / SZ_1K, > + (init_data_size + init_code_size) / SZ_1K, bss_size / SZ_1K, > K(physpages - totalram_pages() - totalcma_pages), > K(totalcma_pages) > #ifdef CONFIG_HIGHMEM > @@ -9055,7 +9055,7 @@ void *__init alloc_large_system_hash(const char *tablename, > > /* It isn't necessary when PAGE_SIZE >= 1MB */ Huh, how could we ever have that. Smells like dead code. > if (PAGE_SHIFT < 20) What about adjusting that as well? The it exactly matches the comment if (PAGE_SIZE >= SZ_1M) > - numentries = round_up(numentries, (1<<20)/PAGE_SIZE); > + numentries = round_up(numentries, SZ_1M / PAGE_SIZE); > > #if __BITS_PER_LONG > 32 > if (!high_limit) { -- Thanks, David / dhildenb