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 B8047C54EBE for ; Mon, 9 Jan 2023 14:31:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2A3A88E0003; Mon, 9 Jan 2023 09:31:07 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 253B38E0002; Mon, 9 Jan 2023 09:31:07 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0F48B8E0003; Mon, 9 Jan 2023 09:31:07 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 021558E0002 for ; Mon, 9 Jan 2023 09:31:07 -0500 (EST) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id CBC79160ADE for ; Mon, 9 Jan 2023 14:31:06 +0000 (UTC) X-FDA: 80335497732.28.460E3AD Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf10.hostedemail.com (Postfix) with ESMTP id 5BB8CC000F for ; Mon, 9 Jan 2023 14:31:04 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Qv91eR63; spf=pass (imf10.hostedemail.com: domain of jlayton@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=jlayton@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1673274664; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=L/5CxOh6JMVjx4DWpk0WTYPdAcLVAF5Kf4Udq+XxJnU=; b=wErEUBtraWTgBZLaVw/AYIrH0y3kiWOtyCg+JWvLu99oqAjhn67Uq6slivwffH075NJ3Q1 7yxUrnncTmyPjUJd6wiREZGUGvYvIXrd7V+u/01fXOICjNVG/1jMG6rnAtFNLrgYpNBACp k9fBJ4RKpstfOhVYJewltc9qK5Skqfo= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Qv91eR63; spf=pass (imf10.hostedemail.com: domain of jlayton@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=jlayton@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1673274664; a=rsa-sha256; cv=none; b=nuZnDamCFoFbPb/Ht093wpjA4tglvHB36fsNNcU8g9yXLXIVk3OnxV+ihGZnMi6mCooduU IDjV6v3FKik0ZNoT3xptKBhaPHjE0qZS6fd3At0xbia69HD6o5IH0ggqVUdJMyb5pmJ9Ei B8LqTYavKJxFc2QybAuA/Ihb7VrUscc= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673274663; h=from:from: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=L/5CxOh6JMVjx4DWpk0WTYPdAcLVAF5Kf4Udq+XxJnU=; b=Qv91eR63Tk1JM8qGM9BRbV2TBLeGgwmxHQ/K8M619BjpgOm3Ccum/fvsNFJiebgcvg5jTM gmh1PrLxaFjZcLB7zg+IJQycvscxgwEY5SAvXVFC91z//lbzzny6kRYTwBVkJJF4+a/r5k GL6RlPyx9Gw0E1MOxylaYdaefQE3w+U= Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-189-UKDEm1SuPmqSQzB1LJ7kMg-1; Mon, 09 Jan 2023 09:31:02 -0500 X-MC-Unique: UKDEm1SuPmqSQzB1LJ7kMg-1 Received: by mail-qk1-f197.google.com with SMTP id r6-20020a05620a298600b007025c3760d4so6556896qkp.1 for ; Mon, 09 Jan 2023 06:31:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=L/5CxOh6JMVjx4DWpk0WTYPdAcLVAF5Kf4Udq+XxJnU=; b=recwFwupxtDABo0Ka5rO1ihdD3V1FiXxytVvMsB4eNHF8eV8ZSr7gN1zbfZveffXcN Du8P67RWtfnbZcG8IzMDPmFaKpI4RDERY9tqD080smmGPSyLKlemJRdtNhRBJrEEbU5m S30B7zfy3cozm6XmqdrZC8aYv//doNJNi8nCSPicu4dq6UFzUcEgeohUd0tBQgQ+oZd0 vbhZEVnF8UjEbZUsVilLieHvEym6FG+ZUjYJgdNsuS3rXMYYjLlR6tfQ2vgvkS6Xun1j T1cF7p/knItlFJd7a8pKI3STAwM+1mv9TJp/LPhZLy4rm3xqYtQxKBgohK3tKPLyW6VJ YA/w== X-Gm-Message-State: AFqh2kpZRkrnc9CQHbQHCyVVGaUDtDIJ4OFx3zaLXV8hnk0R+R6A7gAY nYC+eo1TeYApADBIhoMuSipJF40ImKYICa59SVgyivgFfYY2+5jNDKib8Fi3vRJhFEhakrq5w04 JG02t21CubIU= X-Received: by 2002:a05:622a:258c:b0:3ab:9ef8:f7e8 with SMTP id cj12-20020a05622a258c00b003ab9ef8f7e8mr61154359qtb.42.1673274661757; Mon, 09 Jan 2023 06:31:01 -0800 (PST) X-Google-Smtp-Source: AMrXdXs2PjV6Le5BW95OcfwC5I0zXYI7ZeewrhxYZzbihODOMKdAREvC1S3JTRjDCftXyp1XLCxvtA== X-Received: by 2002:a05:622a:258c:b0:3ab:9ef8:f7e8 with SMTP id cj12-20020a05622a258c00b003ab9ef8f7e8mr61154334qtb.42.1673274661522; Mon, 09 Jan 2023 06:31:01 -0800 (PST) Received: from [192.168.1.3] (68-20-15-154.lightspeed.rlghnc.sbcglobal.net. [68.20.15.154]) by smtp.gmail.com with ESMTPSA id x23-20020ac87ed7000000b0039467aadeb8sm4588461qtj.13.2023.01.09.06.31.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Jan 2023 06:31:01 -0800 (PST) Message-ID: <05df91ed071cfefa272bb8d2fb415222867bae32.camel@redhat.com> Subject: Re: [PATCH 02/11] filemap: Remove filemap_check_and_keep_errors() From: Jeff Layton To: Matthew Wilcox Cc: linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Christoph Hellwig Date: Mon, 09 Jan 2023 09:31:00 -0500 In-Reply-To: References: <20230109051823.480289-1-willy@infradead.org> <20230109051823.480289-3-willy@infradead.org> <36311b962209353333be4c8ceaf0e0823ef9f228.camel@redhat.com> User-Agent: Evolution 3.46.2 (3.46.2-1.fc37) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="ISO-8859-15" Content-Transfer-Encoding: quoted-printable X-Stat-Signature: y6dh7wn8xpsrzmuw8ii546k911nc5d4i X-Rspam-User: X-Rspamd-Queue-Id: 5BB8CC000F X-Rspamd-Server: rspam06 X-HE-Tag: 1673274664-987034 X-HE-Meta: U2FsdGVkX18H2C2TpkIHNIgUYLnae3zoh+hyKiMoQCfNIFvzt+jmhW8MTpgU0LvGm29s5SHv5s0hydNE31ZKgoyCKIRkUJkI0pOr+gFnXeH1auYtnSlIQrl4im35xSq/AHxXM7kQtEoDD8Z4N5T3D1zrg116vHRvNL88IJWjaTH/ac1PMzVZNXOiWXsR58YVwFWgkRyjHbOh1cwbG9bEdUNTJLoVtvAPyGKiHKaJAQvCjCmRdDNxvaJEklKw2oVHkupZv+OwcVaDuf+W+7HZ+0FCPEnd613dpZ7ndAPEa5Nq4d/400svFUIb3eLRhTfurdCFTxvFc0DdnabldUYBi1SwGmVl2McoUUqVXOV+lN4YJPIv4df+y4e0w/5pD5lffVSR6qPDYaRUmpb9zrfK9wNO5HpoYPjiMfNf/pyUFP1KIQCNKnQouujY1oXkJ0AH4lWc3BYSUztSWk1woWrXcUwY6OFsSgV37SDNacviGR2luyyCtWFWutZ687/hUXhGK38hSxCJkuy3yre9n4uEhoX5Ho6y7+IwwoKCgbu6HN1no7drHqD8X5OeUPGgdSpMsMYgIZmXGC63uDnYMGRVS3a6aksG3yqUc05i8/DTYfSScnNs4ILxF47c1Ury6s3AvGOPntzpo7lhXfmBfFckjUFjL3KH9B4N90I3svULp8Rd+z0mT6kmpVifpB2PeMfE1HAZfIfsGHC57cmxsv/ax5aOOt6zDz7KsZgjVfUvs7ofqvFHlrJSvVBNzjTa2Cj2+b1HaNbCADZPGgjtGb3EE+LEELjHbxZkLKfmjXFIEkQ9oJ5/6wO4Tiz5IU9N/uexheFtXW8PJNGTPudTGOzeRT0UAkvNwSdyqxw25Ane6f4rJuNFKBYH21l6q8nNAFwoht/BNhVITnQuYx+y2R7CEA9vmqvvQ/vGUdDpXrEyyDTYPHX/if9e5B2veUKhtjxPWuC+2uJi4OOYZ3PL0EG x3Ah/6zc kFII7Qp8QY9fqTCQ2Pcwx1YNcUAfVx5ENDb2NoBCDfTVagH6D4ALjpSgNFyIN468jtShyRCmBeaGHcfBR0dwZNXXKjbKwKkE6cit5Miu4mbEcWvYV3rxvikHCxu466phnQ0f0RmXRGbjxkFWzHXvKHPOBMw== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000001, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, 2023-01-09 at 14:02 +0000, Matthew Wilcox wrote: > On Mon, Jan 09, 2023 at 08:48:49AM -0500, Jeff Layton wrote: > > On Mon, 2023-01-09 at 05:18 +0000, Matthew Wilcox (Oracle) wrote: > > > Convert both callers to use the "new" errseq infrastructure. > >=20 > > I looked at making this sort of change across the board alongside the > > original wb_err patches, but I backed off at the time. > >=20 > > With the above patch, this function will no longer report a writeback > > error that occurs before the sample. Given that writeback can happen at > > any time, that seemed like it might be an undesirable change, and I > > didn't follow through. > >=20 > > It is true that the existing flag-based code may miss errors too, if > > multiple tasks are test_and_clear'ing the bits, but I think the above i= s > > even more likely to happen, esp. under memory pressure. > >=20 > > To do this right, we probably need to look at these callers and have > > them track a long-term errseq_t "since" value before they ever dirty th= e > > pages, and then continually check-and-advance vs. that. > >=20 > > For instance, the main caller of the above function is jbd2. Would it b= e > > reasonable to add in a new errseq_t value to the jnode for tracking > > errors? >=20 > Doesn't b4678df184b3 address this problem? If nobody has seen the > error, we return 0 instead of the current value of wb_err, ensuring > that somebody always sees the error. >=20 I was originally thinking no, but now I think you're correct. We do initialize the "since" value to 0 if an error has never been seen, so that (sort of) emulates the behavior of the existing AS_EIO/AS_ENOSPC flags. It's still not quite as reliable as plumbing a "since" value through all of the callers (particularly in the case where there are multiple waiters), but maybe it's good enough here. I'll look over the rest of the set. Thanks, -- Jeff Layton