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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6FB6DCA0EC7 for ; Mon, 11 Sep 2023 22:00:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238264AbjIKWAN (ORCPT ); Mon, 11 Sep 2023 18:00:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45440 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237718AbjIKNLr (ORCPT ); Mon, 11 Sep 2023 09:11:47 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A40D2EB; Mon, 11 Sep 2023 06:11:43 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 5C44C21846; Mon, 11 Sep 2023 13:11:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1694437902; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=dAnggcIlt7gXO1y/HPyY0b6GxiBZLKtzxMTmkT2O7rM=; b=DJYa/aPW6CAm2WlLnbW5KJO3XGRc5Dai0Q10q1uOkqmgSNq0uKLo7puZ/HozKYaHC6603K Xd0keI4YJWugG1I69OR92Hy+/F9seThNKxFw3laAgo+kygOX1MiZpicUjF72v0I8SIpx/E oWAyV2AkEAWgRDXnn0R3Q+yNRRQLCoU= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 2D05713780; Mon, 11 Sep 2023 13:11:42 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id S2jtBw4S/2QNJAAAMHmgww (envelope-from ); Mon, 11 Sep 2023 13:11:42 +0000 Date: Mon, 11 Sep 2023 15:11:41 +0200 From: Michal Hocko To: Wei Xu Cc: Yosry Ahmed , Andrew Morton , Johannes Weiner , Roman Gushchin , Shakeel Butt , Muchun Song , Ivan Babrou , Tejun Heo , Michal =?iso-8859-1?Q?Koutn=FD?= , Waiman Long , linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, Greg Thelen Subject: Re: [PATCH v4 4/4] mm: memcg: use non-unified stats flushing for userspace reads Message-ID: References: <20230831165611.2610118-1-yosryahmed@google.com> <20230831165611.2610118-5-yosryahmed@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 07-09-23 17:52:12, Wei Xu wrote: [...] > I tested this patch on a machine with 384 CPUs using a microbenchmark > that spawns 10K threads, each reading its memory.stat every 100 > milliseconds. This is rather extreme case but I wouldn't call it utterly insane though. > Most of memory.stat reads take 5ms-10ms in kernel, with > ~5% reads even exceeding 1 second. Just curious, what would numbers look like if the mutex is removed and those threads would be condending on the existing spinlock with lock dropping in place and removed. Would you be willing to give it a shot? -- Michal Hocko SUSE Labs