Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp19520pxb; Wed, 24 Feb 2021 16:56:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJxYBMJIk9pb0MEXcVJqdt08yWj8ESoOTJpQ8NlGMe5fgC14vN+V/xcnfWIS1Pu60dAURTNr X-Received: by 2002:a17:906:934f:: with SMTP id p15mr260878ejw.473.1614214573191; Wed, 24 Feb 2021 16:56:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614214573; cv=none; d=google.com; s=arc-20160816; b=gtV5hLUy6WMHPTRNBm/eX5amZXkYwrhoWa3484zzciSwSg6d0B4wPUsprs5aCANZt4 UE/CHzyyR33Fin33Tlw7PrJP4VDHBFCMmKJgXCIsMIzIwDwo/h7a42Y2/PUZFvkcENuw ldFNCwGlBLq+Wjd9UC8xgKsAMwPF9TDiT1g/ivfBidivZBYk5XuWSszKr1I51KZrNcrm veT434WX+nzuxA8CFmAnIfPWNfPSDdtXDizQdp26wBNfGPpkiK5lgRFx7O16QlB0blwd YavBWoQdj3ipF0EV5R5xpY6Z3DtcRDkTb1X9jTAnUfRgMkzc9kuBWioAHLmQwLjV2H7R VSGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=xqha6KaFHgtvIKBaYdn52JwvfxXRN9RcHQ72fzYOeuc=; b=VTA8Yzo1ZTjbVOEmnaQnpEo3g8z6rDQX1xcUED3QtxGhJocZ3HKQw1tS1sukyonlEM ueX5EhwertrWv3Yw/dGRgCQkVXfHMxGvOjT0YhzHvZtb1Gxm8ZffYl1iHwRdnMn3Va6H 6MXOgHPsuI1uofGxs8cazhEsjDf10773TUQAKdpj576zDibgnY7OLcRRC85QZkyWcGfg eacvM3GWk/LMeOFoixnkyPb/XnYFxYFYTLtMkKR3GticIwSu4HIvU52IVl9ShPc92c5p RoB8kfcVYiv5fVLGAwJu2uww4AeM7/wA/UOga7PByFRGYZl42Kf/InsbA9dc6MX4aXDp yV9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=sXng7xDN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a25si2338623ejd.541.2021.02.24.16.55.50; Wed, 24 Feb 2021 16:56:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=sXng7xDN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238304AbhBXOuz (ORCPT + 99 others); Wed, 24 Feb 2021 09:50:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45164 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237680AbhBXNmO (ORCPT ); Wed, 24 Feb 2021 08:42:14 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB702C061797; Wed, 24 Feb 2021 05:41:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.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; bh=xqha6KaFHgtvIKBaYdn52JwvfxXRN9RcHQ72fzYOeuc=; b=sXng7xDNXehmcnr+hW/CSKnK/Q rvJT1OrIAsqWa9NN8xPC9n3JB67aLuQc2z/fV0E1k3Ec/VnIEdSzmtm1OAdBOJq1uPxrXe9j35Var hgFb42qG7+e4qFPooFPcxYWXx5OwRaM5RixwDaIlmOM4BaZFTtYvMZpL57/LvY9Pq/ufZ7zgSNxH6 YirC1u+3y9MMSC14hmmHiSkNiAI9PSRdM5kq0tTHEU8xFm74X0qWSGMpNyG4yP+YTs+LTIn9rvQw2 n1NkwimRKMjDpd5nbMqzJHT5MoOlSfnFjidjke0IfLaJQJPsUAq8vIocd5kZE8FA2HsJJsdogN0B2 wHLmVtyA==; Received: from willy by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1lEuPj-009SVQ-M3; Wed, 24 Feb 2021 13:41:16 +0000 Date: Wed, 24 Feb 2021 13:41:15 +0000 From: Matthew Wilcox To: Jan Kara Cc: linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Christoph Hellwig , Kent Overstreet Subject: Re: [RFC] Better page cache error handling Message-ID: <20210224134115.GP2858050@casper.infradead.org> References: <20210205161142.GI308988@casper.infradead.org> <20210224123848.GA27695@quack2.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210224123848.GA27695@quack2.suse.cz> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 24, 2021 at 01:38:48PM +0100, Jan Kara wrote: > > We allocate a page and try to read it. 29 threads pile up waiting > > for the page lock in filemap_update_page(). The error returned by the > > original I/O is shared between all 29 waiters as well as being returned > > to the requesting thread. The next request for index.html will send > > another I/O, and more waiters will pile up trying to get the page lock, > > but at no time will more than 30 threads be waiting for the I/O to fail. > > Interesting idea. It certainly improves current behavior. I just wonder > whether this isn't a partial solution to a problem and a full solution of > it would have to go in a different direction? I mean it just seems > wrong that each reader (let's assume they just won't overlap) has to retry > the failed IO and wait for the HW to figure out it's not going to work. > Shouldn't we cache the error state with the page? And I understand that we > then also have to deal with the problem how to invalidate the error state > when the block might eventually become readable (for stuff like temporary > IO failures). That would need some signalling from the driver to the page > cache, maybe in a form of some error recovery sequence counter or something > like that. For stuff like iSCSI, multipath, or NBD it could be doable I > believe... That felt like a larger change than I wanted to make. I already have a few big projects on my plate! Also, it's not clear to me that the host can necessarily figure out when a device has fixed an error -- certainly for the three cases you list it can be done. I think we'd want a timer to indicate that it's worth retrying instead of returning the error. Anyway, that seems like a lot of data to cram into a struct page. So I think my proposal is still worth pursuing while waiting for someone to come up with a perfect solution.