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=-0.8 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 D0F7CC433E1 for ; Wed, 24 Jun 2020 14:10:24 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8E67B20823 for ; Wed, 24 Jun 2020 14:10:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="CxF+nmcE" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8E67B20823 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 304E26B0003; Wed, 24 Jun 2020 10:10:24 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 28D086B0005; Wed, 24 Jun 2020 10:10:24 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 154DD6B0006; Wed, 24 Jun 2020 10:10:24 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0118.hostedemail.com [216.40.44.118]) by kanga.kvack.org (Postfix) with ESMTP id F27AA6B0003 for ; Wed, 24 Jun 2020 10:10:23 -0400 (EDT) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 8FA303CF8 for ; Wed, 24 Jun 2020 14:10:23 +0000 (UTC) X-FDA: 76964290326.24.men43_031857c26e44 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin24.hostedemail.com (Postfix) with ESMTP id CBAD51DAEF for ; Wed, 24 Jun 2020 14:10:15 +0000 (UTC) X-HE-Tag: men43_031857c26e44 X-Filterd-Recvd-Size: 2735 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf32.hostedemail.com (Postfix) with ESMTP for ; Wed, 24 Jun 2020 14:10:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=xWSo4TF1CxXuck4PIgUP0X+nO2qjx3mneKPxBCTjU4s=; b=CxF+nmcE0nAA0hoDXhyeN84AFC NfE69tggSN3TOYQLVfUmpk1LRlLWyvjHPmn+SvWmk8K1+WM01pBJTRC4SAexpUs4Af+qZoKE6zzQp XyGWMG/XFq2iTfgD6dEOsvIXzWkpSSoFcHKxVsSrkFxw3WCIo6EINWjM03+c0a/720vR54hMpBsdA 2/FvXYNHPiJY32K1sBRFj/pRs3tUn7xGIFEYU9pcsc1V42ibXoCQEsrmQVB/I9CMU8/HyXJpt8VcR Ku5GkoqhZuyln9eMFmM6Ru4de8SCzpipZp5O7meVJOEcVeRRfwrIJNvgloTvMEP2azzdEjwWOFDAF aTCbnAtg==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jo66A-0008Pa-Ce; Wed, 24 Jun 2020 14:09:58 +0000 Date: Wed, 24 Jun 2020 15:09:58 +0100 From: Matthew Wilcox To: Rafael Aquini Cc: Joel Savitz , linux-kernel@vger.kernel.org, Vlastimil Babka , John Hubbard , Andrew Morton , linux-mm@kvack.org Subject: Re: [PATCH] mm/page_alloc: fix documentation error and remove magic numbers Message-ID: <20200624140958.GN21350@casper.infradead.org> References: <20200624032712.23263-1-jsavitz@redhat.com> <20200624111255.GL21350@casper.infradead.org> <20200624140727.GA1987277@optiplex-lnx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200624140727.GA1987277@optiplex-lnx> X-Rspamd-Queue-Id: CBAD51DAEF X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam01 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 Wed, Jun 24, 2020 at 10:07:27AM -0400, Rafael Aquini wrote: > On Wed, Jun 24, 2020 at 12:12:55PM +0100, Matthew Wilcox wrote: > > On Tue, Jun 23, 2020 at 11:27:12PM -0400, Joel Savitz wrote: > > > In addition, this patch replaces the magic number bounds with symbolic > > > constants to clarify the logic. > > > > Why do people think this kind of thing makes the code easier to read? > > It actually makes it harder. Unless the constants are used in more > > than one place, just leave the numbers where they are. > > > > > @@ -7852,6 +7852,9 @@ void setup_per_zone_wmarks(void) > > > * 8192MB: 11584k > > > * 16384MB: 16384k > > > */ > > > +static const int MIN_FREE_KBYTES_LOWER_BOUND = 1 << 7; > > > +static const int MIN_FREE_KBYTES_UPPER_BOUND = 1 << 18; > > > + > > I think these constants would look better if declared as an enum. Why does having to look in two different places make the code clearer?