Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1153714imu; Fri, 21 Dec 2018 13:37:59 -0800 (PST) X-Google-Smtp-Source: ALg8bN5OX7uy8a2UopbPko4hR1HmxfhQxGjwaUPY9F6AsaXoxFDBRBXrT6StirvBKyAZlxwnKzSo X-Received: by 2002:a63:5346:: with SMTP id t6mr4090369pgl.40.1545428279028; Fri, 21 Dec 2018 13:37:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545428278; cv=none; d=google.com; s=arc-20160816; b=UuiI1gJWX7oVkDNpGN1gjJevvjw2FS0WQwT9Bj34f3wIrkYs5j20Fzu7VHdxxb7hfe ihrLZNlvQ5vg+nLqKZtp4CF1X5DyWn4fkH+CGXkgE2rLm3Iy1Km+THPcMnxawNsHO+bj iuxAOgYHzLFl/PR8hVJKnPQkOpOxFJLUy1e8TPtoIcTE1LlCnDcmuOWrETBC7yBW3qJo slya7iwLbCozcQpVus6fDezXQQi1A72yonn4pmgNnlwZArqXlO2AKusjrhCy6DWRNgN2 EGVuaAaPzoIBvQl2ee5V1AUvzzvByNMGq9+r64mRiCLYhHZ8MBlSWrhfSkL7bOMXueCt HihQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=c2UAElxy6bFokRO0JfnODxJ67MS9uqYE6zTrBkA7o88=; b=YmfeLxm4dsFkqpRNZ3B/LMRHnXxPtFC60rjRUQ4ngZBYVg75Fhm+mHNDQKlgnAS/+C M8wuHiQSX8KjKiu8AHSZxoCkdHl6x3pmId7fkMxmK/Yy3/XuMGf/U0YHv0uvqIYnTMyQ wrEkQ5xreuUeDJM5RH/TQr9mCWc7QyMQDBcSe7v6BCF2cLdZ7Iv/hwd4YFLDkceGZl6a 4kJTvECXAnuDDErnn/8Pn7jBlyOuoT/eoQafLGWNMFdW8RkoccsR5o4wqxWrR/RklFOw rYWZED50Wj17e18i+x9GZUgc3pvdvcjOMrQpr8A4VCIRFCYAsNPJz7E8F+VGXGIvogzo Rs8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=OM5GHSgQ; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q3si22945797plb.209.2018.12.21.13.37.41; Fri, 21 Dec 2018 13:37:58 -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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=OM5GHSgQ; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390610AbeLUNY0 (ORCPT + 99 others); Fri, 21 Dec 2018 08:24:26 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:41268 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388588AbeLUNYZ (ORCPT ); Fri, 21 Dec 2018 08:24:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.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:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=c2UAElxy6bFokRO0JfnODxJ67MS9uqYE6zTrBkA7o88=; b=OM5GHSgQljCnq0bqQBYpoMk71 Gu6S/GCvQlKg6JqHAa6kGgtJNsJv2ExZ3vOR+HYFC4RDsYoKsvNcv7z0aSHMwKfkPKbM7r0BGdkTy O53Wtd37R8a7bb+2LNbRHlgRemSWSWzdJIkpJmEj2RYmfe2gmAvSVQD2/GLdRrXhSZUq6HJn5Zbbd d0blzw5iZerKGmc5L14Vs39ZtlKToEIeqAesIuCH903TyldjNHZWR3sHijfEPI88eXza/bFXyoifC CTop9JgYjrwa7bXlVIoqXA59XqLImjxB/rtHa2eF1fjMcwypilk8CZjR/vxCx2gOBFD+xEJ+Cp8SJ CMgGyy9qQ==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1gaKmu-00036H-08; Fri, 21 Dec 2018 13:24:24 +0000 Date: Fri, 21 Dec 2018 05:24:23 -0800 From: Matthew Wilcox To: Nikolay Borisov Cc: linux-mm@kvack.org, akpm@linux-foundation.org, linux-kernel@vger.kernel.org, linux-afs@lists.infradead.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH] mm: Define VM_(MAX|MIN)_READAHEAD via sizes.h constants Message-ID: <20181221132423.GA10600@bombadil.infradead.org> References: <20181221125314.5177-1-nborisov@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181221125314.5177-1-nborisov@suse.com> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Dec 21, 2018 at 02:53:14PM +0200, Nikolay Borisov wrote: > All users of the aformentioned macros convert them to kbytes by > multplying. Instead, directly define the macros via the aptly named > SZ_16K/SZ_128K ones. Also remove the now redundant comments explaining > that VM_* are defined in kbytes it's obvious. No functional changes. Actually, all users of these constants convert them to pages! > + q->backing_dev_info->ra_pages = VM_MAX_READAHEAD / PAGE_SIZE; > + sb->s_bdi->ra_pages = VM_MAX_READAHEAD / PAGE_SIZE; > + sb->s_bdi->ra_pages = VM_MAX_READAHEAD / PAGE_SIZE; > + sb->s_bdi->ra_pages = VM_MAX_READAHEAD / PAGE_SIZE; > + sb->s_bdi->ra_pages = VM_MAX_READAHEAD / PAGE_SIZE; > -#define VM_MAX_READAHEAD 128 /* kbytes */ > -#define VM_MIN_READAHEAD 16 /* kbytes (includes current page) */ > +#define VM_MAX_READAHEAD SZ_128K > +#define VM_MIN_READAHEAD SZ_16K /* includes current page */ So perhaps: #define VM_MAX_READAHEAD (SZ_128K / PAGE_SIZE) VM_MIN_READAHEAD isn't used, so just delete it?