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 X-Spam-Level: X-Spam-Status: No, score=-3.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 84E92C43461 for ; Thu, 17 Sep 2020 13:40:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D6E18206A2 for ; Thu, 17 Sep 2020 13:40:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="KQDtXc5Q" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726683AbgIQNkp (ORCPT ); Thu, 17 Sep 2020 09:40:45 -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*().