Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp2693674rwb; Sun, 15 Jan 2023 20:45:32 -0800 (PST) X-Google-Smtp-Source: AMrXdXtgNs6lwhfqwD3V6Q5CBx0/sAEpN+4DhhHa0/aPX69DHlT6jzurx/PMrkKvOxL4qZMpejPN X-Received: by 2002:a17:907:a508:b0:7c1:539b:d028 with SMTP id vr8-20020a170907a50800b007c1539bd028mr79898851ejc.48.1673844331976; Sun, 15 Jan 2023 20:45:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673844331; cv=none; d=google.com; s=arc-20160816; b=jo8JBqR75XJm6mhJAfbh5dXLk6JHvDHn3Me3uy4uMxwUSBdYbB0TSpWuqf1knaRoL2 gVSdv7KPU3UQsCusT0UwjX2Nj1yff016tWL54VirEC+zprYpAdFkiooLb0QmrBPORH9m adUcS+dnb+PWIMS0TilWg6GINWpKd4BbMVUGdLKalKzHPLg2SsSP/WUAD/A8xZY1CJKh aEZlvjGvcsse1E8iBaV9SofxG6z6PaKT3dpsC4GL7qHDcTokdwsiGCD21zNXpF8PLsl2 LCacAFhqSAvX9DSYDv+B4i98ICa4mC5xtcaNqC9FGqQ7kMd48WQyA/r7+6LHYoe16VCg LiAw== 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=PDkdlvplykONDhtm6dJQ9N1joXtgLBKkIFPyp5U/kn4=; b=aZdFZiedPScOs5gOul0yBBN/xzhVvlxb6lRsooyp2uVKdm52WVBnfny3+FN7x/J+t4 ol7JDdlHqOEdODILcOcQ4all3H6d7yAmNeWPN65qYGnFDpTLD9NruAm+xDmp4VPIk5yF JlaBkzltcmt/XlhMrdLRXbtHfctp4pHHiC+Jqu5YkmFP3TdUlkzR2fOzmR8Uxo7QASga 5b5Qjajv9lO82kH9wYSdWlCnxYwil7ZfhBsrx88J1+/5Qh7ki++lOEKHGOezcO3RdSOd xdd9Z5Iw1kgUy8XH6XFfSqTipwwL95Do6tn3Pv4cStOS3XzntMBL8W6VsADiV1fK9575 wwew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=Rh9FRGbO; 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 l19-20020a056402125300b0049deaf9d2absi5879196edw.126.2023.01.15.20.45.19; Sun, 15 Jan 2023 20:45:31 -0800 (PST) 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=casper.20170209 header.b=Rh9FRGbO; 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 S231862AbjAPEiI (ORCPT + 52 others); Sun, 15 Jan 2023 23:38:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58014 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231686AbjAPEiE (ORCPT ); Sun, 15 Jan 2023 23:38:04 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B893F72A9; Sun, 15 Jan 2023 20:38:02 -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=PDkdlvplykONDhtm6dJQ9N1joXtgLBKkIFPyp5U/kn4=; b=Rh9FRGbOBXc8wtDvk20k7DdbHW zvbTl0mBX2a7wrR+XeZaZwQwOzdDzgFpsqH3ENndlxsNKLtB+IHvkz9tF/p9VUEmHCsNwUtcNtTZB GeByJS4I+sWG7Ut9m0rzx/43/mbInl0Hv60JehkUYQfc5pPzb0Jf85bjHpcqhAVz3ht63rABKVcA+ b3OIsGBScxCafRSkOn+ACgfqnNh2jN+44l9ddqsArleNjsD9yt/jCHt1fHdKc+YoHwU5u+qwA/nhD Siqf8BcmzF+/GfP1mcjNO0himzCNRbIyK7fEYevlNjl21x8AU/HLfH0bKh4l9NjLt35yMflXTUaNU hUSqmaUw==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1pHHFx-008QQF-WF; Mon, 16 Jan 2023 04:38:02 +0000 Date: Mon, 16 Jan 2023 04:38:01 +0000 From: Matthew Wilcox To: maobibo Cc: Hongchen Zhang , Andrew Morton , David Howells , Sedat Dilek , Alexander Viro , "Christian Brauner (Microsoft)" , Luis Chamberlain , Mauro Carvalho Chehab , Eric Dumazet , "Fabio M. De Francesco" , Christophe JAILLET , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] pipe: use __pipe_{lock,unlock} instead of spinlock Message-ID: References: <20230107012324.30698-1-zhanghongchen@loongson.cn> <9fcb3f80-cb55-9a72-0e74-03ace2408d21@loongson.cn> <4b140bd0-9b7f-50b5-9e3b-16d8afe52a50@loongson.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4b140bd0-9b7f-50b5-9e3b-16d8afe52a50@loongson.cn> 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 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 On Mon, Jan 16, 2023 at 11:16:13AM +0800, maobibo wrote: > Hongchen, > > I have a glance with this patch, it simply replaces with > spinlock_irqsave with mutex lock. There may be performance > improvement with two processes competing with pipe, however > for N processes, there will be complex context switches > and ipi interruptts. > > Can you find some cases with more than 2 processes competing > pipe, rather than only unixbench? What real applications have pipes with more than 1 writer & 1 reader? I'm OK with slowing down the weird cases if the common cases go faster.