Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp143591rwn; Wed, 7 Sep 2022 14:00:56 -0700 (PDT) X-Google-Smtp-Source: AA6agR69cts3ucfsY3sl0DCr8+dIicCRcgPzxyU0uus71xdWdCqBS7etLB8FooqGQj2bm53Zcs5N X-Received: by 2002:a17:90b:3806:b0:200:a878:4ac7 with SMTP id mq6-20020a17090b380600b00200a8784ac7mr365061pjb.223.1662584456150; Wed, 07 Sep 2022 14:00:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662584456; cv=none; d=google.com; s=arc-20160816; b=mO5BNM+IQZas4DyBITaGVNxd09yrJnaI2FvEq8ClN1ue/rBDT8RGM3w7m6ZlQz3BZt u0MH7g4s2qKAej+mNJbcTQe/WKUg5clk78TE6Zk5nrTuIgq9V7IfPwRU9C32MMHrRFCM ODzK32ss2JU3jJuOPIUwNTsKR/NCb9QO8R1/vBbbndX7oQpbWvBqIjEgBjkstPEgYCRX kbSG/+7IBZgPyctL/4HK4yhtYp61KUOcpOWR0eUD3c9+3sMVNRjylCUIGfWol5ul/lfn wmZa6qcoRZGBcPWZ6NiwgEYoN2JRJn3P9A6ng/SaVghgTJ+0XJgdgcbORIQPpL23zK7F wJEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=DqAXMu4cxUuTfBMq13EAY3qywXR4RodRp2JSfowt3Es=; b=z1SRQpkH5ukqmqE2bG54Nk8DMbs5DQWjoW7fp5fUhkZegmPzokpp7Lo9yzlaoYICug MbgDoVZzVyDsuFRrTwQy/VHn4uOZaI3a+YwkBJIaUwVaukAC36wIhOKifEQFPVc93BiB ++2Ak1PuR2RpBIf31gLQw6HfcEMYAdwFWc0NpXz4xbB0uSO13mspWp4+kNuECsS0UiCn LQC888RxbVmAhaxnRDuZR/SRFZbe4HJVg+W8pagfmfMbt/yKV6hN2yFak8D4Uq5ZhPXW N1HYGn2bBroSteVUHPj9JcREHodtIgK+TKvcnddLB+Y3pHvCALt/rBF2/iqIlQPM9nic TfRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=GCuThdvv; 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 d19-20020a17090ae29300b001faf5333194si202273pjz.12.2022.09.07.14.00.44; Wed, 07 Sep 2022 14:00:56 -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=@linux-foundation.org header.s=korg header.b=GCuThdvv; 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 S229947AbiIGUnZ (ORCPT + 99 others); Wed, 7 Sep 2022 16:43:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43688 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229902AbiIGUnX (ORCPT ); Wed, 7 Sep 2022 16:43:23 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A5A1CC0B66 for ; Wed, 7 Sep 2022 13:43:22 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 42D7E61A4E for ; Wed, 7 Sep 2022 20:43:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1272EC433B5; Wed, 7 Sep 2022 20:43:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1662583401; bh=FRKdhXGWFNIp4ValMgTEBtAERy/TmsP1c+r60idMAtc=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=GCuThdvvW+ISBXwN7pYF3eReAOVwGG4l8qSRElZF8x/O8rzqjZYgy60xJPEFtQ8om DZlGkg5Ynq01RnKTVK2SGLXF4JXtOcdTfvuWUeMvp4/BCPUN9JC9eT3FCGiaTIw9Yl lJwGXZ+YPsdqdsvTt9TiNPm9qou3MbrvAkcGLtp4= Date: Wed, 7 Sep 2022 13:43:20 -0700 From: Andrew Morton To: "Sun, Jiebin" Cc: Tim Chen , Shakeel Butt , vasily.averin@linux.dev, Dennis Zhou , Tejun Heo , Christoph Lameter , "Eric W. Biederman" , Alexey Gladkov , Manfred Spraul , alexander.mikhalitsyn@virtuozzo.com, Linux MM , LKML , "Chen, Tim C" , Feng Tang , Huang Ying , tianyou.li@intel.com, wangyang.guo@intel.com Subject: Re: [PATCH] ipc/msg.c: mitigate the lock contention with percpu counter Message-Id: <20220907134320.01d1693387bde4af5d3100fb@linux-foundation.org> In-Reply-To: References: <20220902152243.479592-1-jiebin.sun@intel.com> <048517e7f95aa8460cd47a169f3dfbd8e9b70d5c.camel@linux.intel.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Wed, 7 Sep 2022 17:39:47 +0800 "Sun, Jiebin" wrote: > I have sent out the patch v4 which use percpu_counter_add_batch. If we use > a tuned large batch size (1024), Oh. Why not simply use a batch size of INT_MAX? > the performance gain is 3.17x (patch v4) > vs 3.38x (patch v3) previously in stress-ng -- message. It still has > significant performance improvement and also good balance between > performance gain and overflow issue.