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 426BCC433F5 for ; Fri, 3 Dec 2021 16:24:45 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AAE3E6B0073; Fri, 3 Dec 2021 11:24:34 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A5CCD6B0074; Fri, 3 Dec 2021 11:24:34 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 923ED6B0075; Fri, 3 Dec 2021 11:24:34 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0105.hostedemail.com [216.40.44.105]) by kanga.kvack.org (Postfix) with ESMTP id 855916B0073 for ; Fri, 3 Dec 2021 11:24:34 -0500 (EST) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 3C63E8C58D for ; Fri, 3 Dec 2021 16:24:24 +0000 (UTC) X-FDA: 78877005648.23.97326EA Received: from mail-il1-f181.google.com (mail-il1-f181.google.com [209.85.166.181]) by imf22.hostedemail.com (Postfix) with ESMTP id BF34B1901 for ; Fri, 3 Dec 2021 16:24:25 +0000 (UTC) Received: by mail-il1-f181.google.com with SMTP id e8so3216085ilu.9 for ; Fri, 03 Dec 2021 08:24:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20210112.gappssmtp.com; s=20210112; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=90CXXtDpoUXsCo9nfedaj/1T+6Q5B8bTEgHzXVw9Azg=; b=BEA/2s/Ki1dcqnOLbISZDLo523f66wo+rNtxnt2qu+NWh6R3o5MfS+plPKn5aoixJR S+tZfnVsktxD7YTHpzaC0dGsvg17jNS7AQmNkUaR0m7ErABrxbcTEYDcF5rzLS2Fueqv Xznf/x4sNinuDQS4/7lrK5Junm4y7z6Tz8pO9ghLArFrVsiCkf/jeSzY7DtvrlqRUcvU G4Iz9n6J4cy3m/7h2zWXUBKCgVBq++B2toAEtGkQRjZ/fzxg2OgE4aLvkRefbVRBAVnD G5JtIHAjZM53/RPt1E7CPDh3Pw6kXq0I4bvl10IQhRm1cGzMKUJSLuB74u+zIXGojeKU P3zQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=90CXXtDpoUXsCo9nfedaj/1T+6Q5B8bTEgHzXVw9Azg=; b=B8G1bus+5k3VX3wByb7CcQ0WMlmKzrKoLavBN7/bvlAHFQLEsxavn3duUXd6h93gm8 uNi+6mCaPqRp76fkRgGsxIKGP2/FVVtudJ2FgBag9nZ0MJnEQGCRQcrcdV2YjWz9GB71 kY9TpLJzfUcmIf0kuDPFOKi+VbsixfE+qbKQ+Ji3RC6h0MGEKisjHJiOp5nmTLGo/1W2 lmi06QqRvD10FkOwhuoeexvn7vJGL6gXD6CXlGRsvyf7B2tFCAn1J8BcmOdrMIfBz79E vqLs0kZF9vC6tmVHmCItYPK0aSSQ2Ei7otvt86QH+Zx5nhEmm7CHbC2iVZ+GPCDVflqJ P9iA== X-Gm-Message-State: AOAM533PmaYTihsTRJmmVkvgYYNE72/xLPXVgO8oxChdSnHXaFBxLsn/ +ZeJJ9VEudw7n1JAi2ooGUSOi+Ob+IkRAzRv X-Google-Smtp-Source: ABdhPJx5erd2UltLNVhrz213l9bb+UP/nNHH8z+CV9vve2u95cTnxRmr1Rp8cnbM+tVx07fBIXOMyw== X-Received: by 2002:a05:6e02:2191:: with SMTP id j17mr18775516ila.120.1638548662948; Fri, 03 Dec 2021 08:24:22 -0800 (PST) Received: from [192.168.1.30] ([207.135.234.126]) by smtp.gmail.com with ESMTPSA id s20sm1852941iog.25.2021.12.03.08.24.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 03 Dec 2021 08:24:22 -0800 (PST) Subject: Re: [PATCH 1/2] mm: move filemap_range_needs_writeback() into header To: Matthew Wilcox Cc: linux-block@vger.kernel.org, linux-mm@kvack.org References: <20211203153829.298893-1-axboe@kernel.dk> <20211203153829.298893-2-axboe@kernel.dk> From: Jens Axboe Message-ID: Date: Fri, 3 Dec 2021 09:24:22 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: BF34B1901 X-Stat-Signature: ddd335ne1epcpzkuyu4oy7npoxawkd63 Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=kernel-dk.20210112.gappssmtp.com header.s=20210112 header.b="BEA/2s/K"; spf=pass (imf22.hostedemail.com: domain of axboe@kernel.dk designates 209.85.166.181 as permitted sender) smtp.mailfrom=axboe@kernel.dk; dmarc=none X-HE-Tag: 1638548665-106839 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000010, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 12/3/21 9:16 AM, Matthew Wilcox wrote: > On Fri, Dec 03, 2021 at 08:38:28AM -0700, Jens Axboe wrote: >> +++ b/include/linux/fs.h > > fs.h is the wrong place for these functions; they're pagecache > functionality, so they should be in pagemap.h. > >> +/* Returns true if writeback might be needed or already in progress. */ >> +static inline bool mapping_needs_writeback(struct address_space *mapping) >> +{ >> + return mapping->nrpages; >> +} > > I don't like this function -- mapping_needs_writeback says to me that it > tests a flag in mapping->flags. Plus, it does exactly the same thing as > !mapping_empty(), so perhaps ... > >> +static inline bool filemap_range_needs_writeback(struct address_space *mapping, >> + loff_t start_byte, >> + loff_t end_byte) >> +{ >> + if (!mapping_needs_writeback(mapping)) >> + return false; > > just make this > if (mapping_empty(mapping)) > return false; > > Other than that, no objections to making this static inline. Good idea, I'll make that change. -- Jens Axboe