Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp520207rwi; Thu, 20 Oct 2022 01:37:04 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6Kr4uNDIAR3rlBSeddyEdZlHlH8pZXSNpX4XnuFNLiu6tmEv1rGcWjqkstL9vp1Iln+zUD X-Received: by 2002:a17:907:3e96:b0:78d:f399:57e3 with SMTP id hs22-20020a1709073e9600b0078df39957e3mr9291534ejc.699.1666255024646; Thu, 20 Oct 2022 01:37:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666255024; cv=none; d=google.com; s=arc-20160816; b=BeTRSjE4wGchbILXu918zv1gGhpUVIfrYqo878yuOa5gfXBzwiMNqh2yA8rJkVvBCi HgobpBESnWd4Zcl3UFpZ0hv5COAeDcx3yaTrzwX/8QoaqsvMe37G6mr8sG7jbGuioVQ2 tNHBLpn6nDev23EnzshWsdjsRBnY5Sq1Z0XivKKshWJQ1jvr56U8i5jtAjf61RqQ8lDe irvtJfJ5ofiQfxCltpKcCZhjKeSMiPF6kO7NA8M4F6SQde76J7PVfl4aFMSNbeisdfMa 84TmOYu5ZjwiLEcrw28TTuolMro1X9J/YVasausKbr0UV5ux2EI6dTabeLRVb+qmGaS6 Cfkg== 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=CiTIzenZZmk7uPE6Az6q81BtgMmAxpSFtivPUoqj25k=; b=SiDaK7zyA6Enw0cm+V0jyct3kTTXmitXyd5Jo3tJVBAiHLosgZjNLtdRcNELslTGhQ MQgfv8Te4AslvUGSMihnYV0EP4+vSud30I8AoxNw8zAvxAMXvfwxOgiAia/9P+DsqOLm Q0cdt7OWE/50492V2xkOpnlxWU4znmOpZN5BM75TpFaQnEfNUuyJC8RWp+PgIAuaGunB 9bRlrydcyiysBQgI0eyyug7/q7T9eyQOpZl707pGidMJ9eirVkzZGZG61iDTqTN2GdaX XyDY8URcUDMWjSivJ6U6unf/pmgZmLwRsaq7s3U0zQyBSinSmGP3HJCmNeqP5MiEpoNd DzPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=wX7LfYDt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id la26-20020a170907781a00b007316843d58bsi13757056ejc.925.2022.10.20.01.36.38; Thu, 20 Oct 2022 01:37:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=wX7LfYDt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230221AbiJTIby (ORCPT + 99 others); Thu, 20 Oct 2022 04:31:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34500 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230146AbiJTIbp (ORCPT ); Thu, 20 Oct 2022 04:31:45 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6756E15F300; Thu, 20 Oct 2022 01:31:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; 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=CiTIzenZZmk7uPE6Az6q81BtgMmAxpSFtivPUoqj25k=; b=wX7LfYDty6UXHOE/DVJRPjnil9 BEq1wb2ggqc0qjufuzzWevD6uqrKlNmI5TXK/lxAojYtpYRty2anESHLFjhXAmAWvTAgiR7atuffN hoLAOfBWkwWZveYAs5x1knJHAmhJgm1lHy+Ut0GVag+vMiomJBertn1L5siNxpJ7qd/OmjUw1Ma7N lUW6vKo7GKMq/q2PNIO9Xx8r9wC5F3abeYPz9u/sCFw1oIZQ2rc9kKd/ZaljOnhPQ4/D2hm3a4i9n AutU2/s4LYmHnhC8Re9nUmWcqbayLj7fkhBPsnSW8A68+Hj8a3ZGIOHwEyvSZ1Z08n2F39rjwDbp1 LHK8tvFQ==; Received: from hch by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1olQxr-00CEMs-8z; Thu, 20 Oct 2022 08:31:43 +0000 Date: Thu, 20 Oct 2022 01:31:43 -0700 From: Christoph Hellwig To: Pavel Begunkov Cc: Jens Axboe , linux-block@vger.kernel.org, io-uring@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [RFC for-next v2 3/4] block/bio: add pcpu caching for non-polling bio_put Message-ID: References: <9fd04486d972c1f3ef273fa26b4b6bf51a5e4270.1666122465.git.asml.silence@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9fd04486d972c1f3ef273fa26b4b6bf51a5e4270.1666122465.git.asml.silence@gmail.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > + unsigned long flags; > > cache = per_cpu_ptr(bio->bi_pool->cache, get_cpu()); > bio_uninit(bio); > @@ -737,12 +776,15 @@ static inline void bio_put_percpu_cache(struct bio *bio) > cache->free_list = bio; > cache->nr++; > } else { > - put_cpu(); > - bio_free(bio); > - return; > + local_irq_save(flags); > + bio->bi_next = cache->free_list_irq; > + cache->free_list_irq = bio; > + cache->nr_irq++; > + local_irq_restore(flags); > } Ok, I guess with that my previous comments don't make quite as much sense any more. I think youcan keep flags local in the branch here, though.