Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp617291ybt; Wed, 24 Jun 2020 07:14:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxn7ain+q5ZENYL0Yt1z4taXaulUEZgeAbxwDC6y9FVDioTPADsAmfyEKCVQYg7m3Swd99Q X-Received: by 2002:a17:906:da0f:: with SMTP id fi15mr1845220ejb.237.1593008059186; Wed, 24 Jun 2020 07:14:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593008059; cv=none; d=google.com; s=arc-20160816; b=aJzDANsTKG8ncgqMZgz35CLnWgDvtkfvksQNGDOciOG8AA1PPuNnuMgJQ4fguDLi8q YYsK2JdY4qWNO8lgV+kqIIpdcXrctajUd7S0wsktTvDwjVDHAvcZFVcxmnV9BH/zLITz mIMXYpWU6Msx1xtzQb+c77mVvKeI8jIQS0lrrC9AIgkCefWR1IwukwhynZZVlnT4vCzW HT9FpJabVcEz1PxENGnVDnEdvwON3Ntn4y8qHzVDshjgElbQ++zQNbsgjIZhOJrKQ2Tr jz3rTSAhbPeUNYPZG57rl7h2oqr9kKEjaKwC/pFjeO3QzAMV+cYosAR1IOd4per0HUxY UIRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=xWSo4TF1CxXuck4PIgUP0X+nO2qjx3mneKPxBCTjU4s=; b=Si39g2TZ/pRQdwaV/FFYA/owU9YvUrIbJ4OoAom9LVmze+2gnxyUTmGfidq/0br7I7 jEMnlgBv3dC9bW9tGMVxgzcCF1urGIcaoNXEZoE6Rv+5Yg5A7K/FWiISN6qa5ONrVVyC 7glU6Jhp0/i77g+2iC3Qo1gly6C0sYnt58kjVCy2I7peYT3abDKXdYJt2YSFgC+Iuhp7 mgz42XTBpeiK3PJHSSTW+qyS7x3IJfMc3eGukDPskVEpODEB2dJ8Yh/BnvUUMle744c0 X3uNV0mwoHA7lySMRiDGS8iMuvW07vm5foSqbXf18jrVchQD/qEG2FkpLwEB1CTwGL+V 1J5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=CxF+nmcE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o5si3291476edj.37.2020.06.24.07.13.53; Wed, 24 Jun 2020 07:14:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=CxF+nmcE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391117AbgFXOKV (ORCPT + 99 others); Wed, 24 Jun 2020 10:10:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388395AbgFXOKU (ORCPT ); Wed, 24 Jun 2020 10:10:20 -0400 Received: from casper.infradead.org (unknown [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C608C061573 for ; Wed, 24 Jun 2020 07:10:18 -0700 (PDT) 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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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?