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 D751BC7EE2D for ; Fri, 24 Feb 2023 16:13:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3BFC96B0071; Fri, 24 Feb 2023 11:13:37 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 36FA46B0073; Fri, 24 Feb 2023 11:13:37 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 236D26B0074; Fri, 24 Feb 2023 11:13:37 -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 128316B0071 for ; Fri, 24 Feb 2023 11:13:37 -0500 (EST) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id D49B4120748 for ; Fri, 24 Feb 2023 16:13:36 +0000 (UTC) X-FDA: 80502680832.03.238C2DF Received: from mail-ed1-f53.google.com (mail-ed1-f53.google.com [209.85.208.53]) by imf21.hostedemail.com (Postfix) with ESMTP id CCF6E1C0007 for ; Fri, 24 Feb 2023 16:13:34 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=google header.b=BpwwamzG; spf=pass (imf21.hostedemail.com: domain of torvalds@linuxfoundation.org designates 209.85.208.53 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=1677255214; 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=uaxBJSgWqvLaoOMxWgJIqaQBEgKPvnccLZuHzDiq+NA=; b=3Q4KgD3TqhHslMBrO4hLCpulJlH6bcGEotDOjPz98AsmEVQxhjtgWBN5hm2Tp5cBGlWG0A /JnBWyiLuIn2jF2B1Fyb1d5TjpEvFNTd+1+Mpee06Tt9SaarWXA2gCi5t+NfxBuuruUpFF w1suC2k+f6etJLO6AycDtK0Ro/fi93o= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=google header.b=BpwwamzG; spf=pass (imf21.hostedemail.com: domain of torvalds@linuxfoundation.org designates 209.85.208.53 as permitted sender) smtp.mailfrom=torvalds@linuxfoundation.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1677255214; a=rsa-sha256; cv=none; b=f+P9KQWikGv6m6rRcmSUQDLtlrSVwav6mIfUp5iievA/YQBMScjdYrmBLb9kXTIrebhK36 b6jKw97RbbDJ4eeMsdLAF+7EAK/SE0otrlne/4LTCQDql+RfRorr384QBU1vXoqp/Omtdm 7LLLeUQafyQV9E5pDbBEsS1IdS3caKc= Received: by mail-ed1-f53.google.com with SMTP id h16so56897160edz.10 for ; Fri, 24 Feb 2023 08:13:34 -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=uaxBJSgWqvLaoOMxWgJIqaQBEgKPvnccLZuHzDiq+NA=; b=BpwwamzG5OF5Y/Wholvr8UuQC8co6VGUxBK9PHdD8OUSHaQY6t6OCRKE3tYMwFqtvY BpxSTehtRoXcyoO6a5GVqmEdBXeJ6c8oE9YuWGTwUkaB9I7oGJflZ9Gt1J5VU2pgxzfb UEfYLbkrCzmH2UZy3e1QalYwtuQgpdE346IwM= 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=uaxBJSgWqvLaoOMxWgJIqaQBEgKPvnccLZuHzDiq+NA=; b=gxtXhf7SIeHlT/QTnp/3tellPUh2Qo+2/h5SAJL6kPyHYaXlW4VmWv4jJlx9K2glYG wzZe8S4Il94wCcCOFdYnfK71GMOqRJ3mRhikif+95E3g8uKZpCyxkk6KAyCnXoGEkSFh bBzsa3wy88KYu2l3s61eFzQf9yQIp3qfCCXcrd+1v8/teNS+Ab7kB8+2g5XsCT7PNHGN fpDY1MTq7cWyUyffEmfRdZqEJvh4uQdAlv4JZxq93KfS+gDxixJuvGk5IrRpVGJeAutF PTV6zgdJVLSPSkCyv3R6J2o6JdeLX4jL6xg6Lt4wRk7BayjHp/5w79sw+Pb20DmO8pJO hFlg== X-Gm-Message-State: AO0yUKWFoONhdicon+k8065dC2soGuc07yosOD8skwvxhRUs+Kqrb8e/ DJFUG/0WmHECUyT1QaFZa+C3mm+NWDVFbD6o5hb45w== X-Google-Smtp-Source: AK7set+uTQrjIiyM6RgX/A8l2aA2s6NdljetCc0Cew7fqJlCPB6g+tdM/mZ2UZ4tTf0DucHlWCTqpA== X-Received: by 2002:a17:906:e2ca:b0:8b2:5e3e:3103 with SMTP id gr10-20020a170906e2ca00b008b25e3e3103mr29031708ejb.49.1677255212557; Fri, 24 Feb 2023 08:13:32 -0800 (PST) Received: from mail-ed1-f43.google.com (mail-ed1-f43.google.com. [209.85.208.43]) by smtp.gmail.com with ESMTPSA id f29-20020a50a6dd000000b004ad6e3e4a26sm7143399edc.84.2023.02.24.08.13.31 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 24 Feb 2023 08:13:31 -0800 (PST) Received: by mail-ed1-f43.google.com with SMTP id h16so56896739edz.10 for ; Fri, 24 Feb 2023 08:13:31 -0800 (PST) X-Received: by 2002:a50:9ecd:0:b0:4ac:c720:207c with SMTP id a71-20020a509ecd000000b004acc720207cmr6674555edf.5.1677255210884; Fri, 24 Feb 2023 08:13:30 -0800 (PST) MIME-Version: 1.0 References: <2009825.1677229488@warthog.procyon.org.uk> <20230220135225.91b0f28344c01d5306c31230@linux-foundation.org> <2134430.1677240738@warthog.procyon.org.uk> <2214157.1677250083@warthog.procyon.org.uk> In-Reply-To: <2214157.1677250083@warthog.procyon.org.uk> From: Linus Torvalds Date: Fri, 24 Feb 2023 08:13:13 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC][PATCH] cifs, afs: Revert changes to {cifs,afs}_writepages_region() To: David Howells Cc: Steve French , Vishal Moola , Andrew Morton , Jan Kara , Paulo Alcantara , Matthew Wilcox , Huang Ying , Baolin Wang , Xin Hao , linux-mm@kvack.org, mm-commits@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Stat-Signature: ngpqj47nxdhomoecxubx8zu15i1f5wrs X-Rspam-User: X-Rspamd-Queue-Id: CCF6E1C0007 X-Rspamd-Server: rspam06 X-HE-Tag: 1677255214-612447 X-HE-Meta: U2FsdGVkX1/MNzCB7VOxzDZ1zNcZRiUeMbiU3aRRda8smRfJQzCM+AYoYAuIjUhn+UnQcLt6uCPiyiDVTowoH5PNv7/0dC3LYqOvWyzqpb7fc/eFcS8UDJDo94SkijTK5NREErSTUIRf0GRRYsTx0sbwxHCrB+fxEwj5iTAeRx6Eg/gZWrEH3W4dhJz9WlOn8/NIjAi4beMOlah2fXYBdQgoMwAg+Gfonl9BQCyVcjKQuHuj+GwNybZgt9zCp+6R6qZQsy8dtRJwJr5e3lw12WxKDLX31L1Zbq+sWOOxeycFFlvtHaRCmoQFA99SIKNdN9P9mA6LhRl75ynkbet9euspGlocOAauCpqF5t1zmxgH0FswYRz8vH+/WyiHtfYafTGsY5vB0X8Hb3BY6TbJkEcEG1wf2BoiO0L4aMzzaC1/dyad1/OsdW5MWKKBUXRslk+FoUt8jN+FQEM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rmKfXgs7xqPp2r3RJU8DJ6fWx4nV5xgCRKc+maKlDAUwaTlM4EkWZifniJbr8Z+P3pNamtt4KQNYEw0hfjXoWLLLNlCBdVGun0cGH+Qa4YMA== 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 Fri, Feb 24, 2023 at 6:48 AM David Howells wrote: > > Here's a more complex patch that reverts Vishal's patch to afs and your > changes to cifs back to the point where find_get_pages_range_tag() was > being used to get a single folio and then replace that with a function, > filemap_get_folio_tag() that just gets a single folio. An alternative way > of doing this would be to make filemap_get_folios_tag() take a limit count. Ack. I think this is the right thing to do. Except we should at a minimum split this into two patches, with the first one introducing that filemap_get_folio_tag() helper function that makes the whole find_get_pages_range_tag() conversion much simpler. In fact, probably three patches - infrastructure, cifs and afs separately. Just to make each patch simpler to look at for people who care about that particular area. And I'd still like to know why that 'skips' logic exists, it seems to be shared with afs. The fact that it actually seems to change semantics by your testing makes me even more suspicious of it than I was when I was doing that "skip_write" thing. (But the change I did was to treat _all_ the skipped writes the same, while the old - and your revert - behavior is to only do the skip counting for the "already under writeback" case. But it still stinks to me). Linus