Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp419681pxk; Thu, 17 Sep 2020 06:42:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx54IQWARphVAT2mBvGd5E3dsR6gPlhc36jCc1Fn7HaP8jxUNZeNabkGCo5TJkPuxjcTk9w X-Received: by 2002:a17:906:6805:: with SMTP id k5mr29804238ejr.397.1600350144255; Thu, 17 Sep 2020 06:42:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600350144; cv=none; d=google.com; s=arc-20160816; b=ZreqIbZvvEU06Cm+6/PR/fQAvcgnl5O/8LTBBu3mQ0gwD64w9bgiY1OpbcOlQZ3paT zNg8mH5YT45spuAsIxqZ3HD+WzC6ogQU0MPhd50Jm9pRIO6l5YnYqAEqqUQrOc/Td3/m reBAB3phBuftqdyDJXtGDhShKcyyqE+8ZF7jV1+ZW+T8TEVnBZ0m63T/+owmmy8xjM3N QuTiIAIgNkhrzuLhUYNnJh7vUUu54remT6Lv5mNXlyqhr90eOhfjJhRi1pQkk8vWbtWp sqWzvc/DEwsu8RYR3oQ3QzcKFCfjQNpczuSHjdRxAp3hFCzvJSG8toF2bYu8s3SdM7vV 0C3A== 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=+x95TOveSKANVP/4NXP/85j+F/QDHBxfUXKmd3k4IkY=; b=YEoxcKVvJI0wd+AvQoTJUrXv/94UFwNNch5zmqO52aOc/DBZ3lohNvnwiIKk5MbGKq /yzfPENoZJi0RahTPDLxZnSiIARQRQk0P3oNVg+TxQmapN2suu4kaHoIjxAtYqz/yt3q ZxpqKTL0Go0fzFnm7IUsE3ioJowrTbuRtxcEwJGyFeDeTUjCc3FugiRI7LfvHoAG4jwW j06YqSEFTWwB/7Xp7GjNXaUadhNKIuDd2VNc5yWFjUaNt67XBwOePQJD1uwl+Wf+V40m wMtn91MIhVG38FrB/0ICXt/q3WyGGODvq+5U0sKy9Bmu9a1mjNdreGySIov+qEyliRPI cZig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=merlin.20170209 header.b=KQDtXc5Q; 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 w23si15270165edl.335.2020.09.17.06.42.00; Thu, 17 Sep 2020 06:42:24 -0700 (PDT) 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=merlin.20170209 header.b=KQDtXc5Q; 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 S1727008AbgIQNj1 (ORCPT + 99 others); Thu, 17 Sep 2020 09:39:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727113AbgIQNeU (ORCPT ); Thu, 17 Sep 2020 09:34:20 -0400 Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0BE17C061756; Thu, 17 Sep 2020 06:22:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.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=+x95TOveSKANVP/4NXP/85j+F/QDHBxfUXKmd3k4IkY=; b=KQDtXc5QckJn09Jm/Ja39DH+Uk xxcqqwltSK9fZ6w7Kd6V1hBp9ikMoXg8gbomb9s7kP2XHhd7lM0naQBMg6RjjPyGlTBnZ9CqAewZP YBMrkVSsWNv4P//FrPhdNdQmWpCFvyupNp/qno+NoxUvgiSbQKqfKolCuygblFt8iWbThqohs3hWl poBHmOUUGUHFooTp12KKoDbiSxegWSjxaxIUxEoacl+BH7Gz+8C5zwbDPN/4KqU33J4uCDwI1dPIK kM4wXFBSnpaxgF4lCFnvHE/xHjx2qEpyzqLl/r7jiVavDy6uIXbji7LU4O0hBDMsY2X8tCbWi4E1Q q9GbsMrQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1kItrt-0002Kk-1K; Thu, 17 Sep 2020 13:22:33 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 873F93006D0; Thu, 17 Sep 2020 15:22:30 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 369752BACAEF2; Thu, 17 Sep 2020 15:22:30 +0200 (CEST) Date: Thu, 17 Sep 2020 15:22:30 +0200 From: peterz@infradead.org To: Matthew Wilcox Cc: Oleg Nesterov , Boaz Harrosh , Hou Tao , Ingo Molnar , Will Deacon , Dennis Zhou , Tejun Heo , Christoph Lameter , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Jan Kara Subject: Re: [RFC PATCH] locking/percpu-rwsem: use this_cpu_{inc|dec}() for read_count Message-ID: <20200917132230.GG1362448@hirez.programming.kicks-ass.net> References: <20200915140750.137881-1-houtao1@huawei.com> <20200915150610.GC2674@hirez.programming.kicks-ass.net> <20200915153113.GA6881@redhat.com> <20200915155150.GD2674@hirez.programming.kicks-ass.net> <20200915160344.GH35926@hirez.programming.kicks-ass.net> <20200917120132.GA5602@redhat.com> <20200917124838.GT5449@casper.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200917124838.GT5449@casper.infradead.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 17, 2020 at 01:48:38PM +0100, Matthew Wilcox wrote: > On Thu, Sep 17, 2020 at 02:01:33PM +0200, Oleg Nesterov wrote: > > IIUC, file_end_write() was never IRQ safe (at least if !CONFIG_SMP), even > > before 8129ed2964 ("change sb_writers to use percpu_rw_semaphore"), but this > > doesn't matter... > > > > Perhaps we can change aio.c, io_uring.c and fs/overlayfs/file.c to avoid > > file_end_write() in IRQ context, but I am not sure it's worth the trouble. > > If we change bio_endio to invoke the ->bi_end_io callbacks in softirq > context instead of hardirq context, we can change the pagecache to take SoftIRQ context has exactly the same problem vs __this_cpu*().