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 AF5BBC4332F for ; Wed, 23 Nov 2022 18:26:58 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 390246B0071; Wed, 23 Nov 2022 13:26:58 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 3401E6B0073; Wed, 23 Nov 2022 13:26:58 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2083B6B0074; Wed, 23 Nov 2022 13:26:58 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 11A8F6B0071 for ; Wed, 23 Nov 2022 13:26:58 -0500 (EST) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id A42EE801C7 for ; Wed, 23 Nov 2022 18:26:57 +0000 (UTC) X-FDA: 80165538474.25.ECB7787 Received: from mail-qt1-f170.google.com (mail-qt1-f170.google.com [209.85.160.170]) by imf08.hostedemail.com (Postfix) with ESMTP id 4AC97160008 for ; Wed, 23 Nov 2022 18:26:56 +0000 (UTC) Received: by mail-qt1-f170.google.com with SMTP id h16so3346240qtu.2 for ; Wed, 23 Nov 2022 10:26:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=T/jG5QaYqTRKNFcJtqKGHj4SfbKFSJH0wslCbBk+0rc=; b=WtEZfFy9CjWS25vRvH8BUGmfQ5TppWVPJY29aYmVjK2t/Gqd80v173byCSBDvOcqZ5 GS3iagkeA7ssVh/ddKEkJKHeWkCPYto/COdNwh44sfuBXjAau3yrVZ6HAJiXAaELgCMQ DakZoiuRSNhC/sDbjfyndFBio5BbqUEFc1b48= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=T/jG5QaYqTRKNFcJtqKGHj4SfbKFSJH0wslCbBk+0rc=; b=oJDwaLIqN/PZCKjXzs/ew4tHmMKh+eO7ddD5CUvYDPqs32Ge89bywolCoN+5faSArp L8gB0d6oi06nH3MkgVE+RqyvSgTySqVjPAcRSN1dfGCHWjkMH46wVuWlHeK2N2p+Xlo4 vtXN3wyU1KP7RNcVyazwFikIvZFn15szon56LvqJlalc5wxUbCsXJTA2ER4059JnAy4W jRhjga2Ak1DULKHIVqobVojoqW8B3DgzmoHBqcf8BIrxxj71HuW+DNYVU1mqtsxaM10o Kt9AQHRmYrmx4nmW7BpvE6ZfBFgkVo85pF+XhIS7jSuFVkbasrW8zkapwxUyIwuNuy8t 0UWg== X-Gm-Message-State: ANoB5pkoPvGK3Sryd2b8VNpp4mPEZv7cNgBGE+M79iLYfColbDmYNfib 8XlGdcxJ52wFP565SKYPi7nb2UIvZSbHVg== X-Google-Smtp-Source: AA0mqf43ULCrWTfJqph+f+HfINSq5zZTZtWCMm0KlzZ6DZgnP9RCaVZNTqf9dFuJQZiWS06uuz8rKw== X-Received: by 2002:ac8:6886:0:b0:3a5:f507:8ed4 with SMTP id m6-20020ac86886000000b003a5f5078ed4mr27480890qtq.450.1669228015245; Wed, 23 Nov 2022 10:26:55 -0800 (PST) Received: from mail-qt1-f172.google.com (mail-qt1-f172.google.com. [209.85.160.172]) by smtp.gmail.com with ESMTPSA id u10-20020a05620a430a00b006fa617ac616sm4104690qko.49.2022.11.23.10.26.52 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 23 Nov 2022 10:26:53 -0800 (PST) Received: by mail-qt1-f172.google.com with SMTP id l2so11758055qtq.11 for ; Wed, 23 Nov 2022 10:26:52 -0800 (PST) X-Received: by 2002:ac8:41cd:0:b0:3a5:1ba7:717d with SMTP id o13-20020ac841cd000000b003a51ba7717dmr9188380qtm.678.1669228012067; Wed, 23 Nov 2022 10:26:52 -0800 (PST) MIME-Version: 1.0 References: <1459152.1669208550@warthog.procyon.org.uk> In-Reply-To: <1459152.1669208550@warthog.procyon.org.uk> From: Linus Torvalds Date: Wed, 23 Nov 2022 10:26:36 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3] mm, netfs, fscache: Stop read optimisation when folio removed from pagecache To: David Howells Cc: willy@infradead.org, dwysocha@redhat.com, Rohith Surabattula , Steve French , Shyam Prasad N , Dominique Martinet , Ilya Dryomov , linux-cachefs@redhat.com, linux-cifs@vger.kernel.org, linux-afs@lists.infradead.org, v9fs-developer@lists.sourceforge.net, ceph-devel@vger.kernel.org, linux-nfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1669228016; a=rsa-sha256; cv=none; b=S8rbfjqliNav0OS5Hqir+G8XiPFMbuBV571Rh7/yendwrbq/bDySFebrfC6vmajyZvL4SO F1X6WlYX1gs8FZfdw1RUuIByhH4oEPw0U1GiPOrpWVXp6/ydUzmFfQX8BkrEu3rrytvubE 7DwEvvo0cc4xa0fvLJktWG0hFdGNO1I= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=google header.b=WtEZfFy9; spf=pass (imf08.hostedemail.com: domain of torvalds@linuxfoundation.org designates 209.85.160.170 as permitted sender) smtp.mailfrom=torvalds@linuxfoundation.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1669228016; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=T/jG5QaYqTRKNFcJtqKGHj4SfbKFSJH0wslCbBk+0rc=; b=ZCTAuSxGgZLs/MCtPEAwRTPWBION31QtvC5CojoYhhSlhMUNAKrY+4Ffgasf1iv0nSYVSQ xlsM5x+bWRsQu1fQNPh5vnABwRVvrQlCAnmEv4ZlbXelIja6N3VkloFKBPO7FfuWyUXn1n sOrpCk5ov2t0VGsenyF8gcRkhUS90yI= X-Rspam-User: X-Rspamd-Queue-Id: 4AC97160008 Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=google header.b=WtEZfFy9; spf=pass (imf08.hostedemail.com: domain of torvalds@linuxfoundation.org designates 209.85.160.170 as permitted sender) smtp.mailfrom=torvalds@linuxfoundation.org; dmarc=none X-Stat-Signature: boyfa6yntjn96dauotg1pomfg4mdmtnm X-Rspamd-Server: rspam10 X-HE-Tag: 1669228016-758297 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, Nov 23, 2022 at 5:02 AM David Howells wrote: > > Is the attached patch too heavy to be applied this late in the merge cycle? > Or would you prefer it to wait for the merge window? This patch is much too much for this point in the release. But I also think it's strange in another way, with that odd placement of mapping_clear_release_always(inode->i_mapping); at inode eviction time. That just feels very random. Similarly, that change to shrink_folio_list() looks strange, with the nasty folio_needs_release() helper. It seems entirely pointless, with the use then being if (folio_needs_release(folio)) { if (!filemap_release_folio(folio, sc->gfp_mask)) goto activate_locked; when everybody else is just using filemap_release_folio() and checking its return value. I like how you changed other cases of if (folio_has_private(folio) && !filemap_release_folio(folio, 0)) return 0; to just use "!filemap_release_folio()" directly, and that felt like a cleanup, but the shrink_folio_list() changes look like a step backwards. And the change to mm/filemap.c is completely unacceptable in all forms, and this added test + if ((!mapping || !mapping_release_always(mapping)) && + !folio_test_private(folio) && + !folio_test_private_2(folio)) + return true; will not be accepted even during the merge window. That code makes no sense what-so-ever, and is in no way acceptable. That code makes no sense what-so-ever. Why isn't it using "folio_has_private()"? Why is it using it's own illegible version of that that doesn't match any other case? Why is this done as an open-coded - and *badly* so - version of !folio_needs_release() that you for some reason made private to mm/vmscan.c? So no, this patch is too ugly to apply as-is *ever*, much less during the late rc series. Linus