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 5B053C83F12 for ; Tue, 29 Aug 2023 07:28:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231893AbjH2H15 (ORCPT ); Tue, 29 Aug 2023 03:27:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33546 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233678AbjH2H1p (ORCPT ); Tue, 29 Aug 2023 03:27:45 -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 D2D44B5; Tue, 29 Aug 2023 00:27:42 -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 8B9F62184F; Tue, 29 Aug 2023 07:27:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1693294061; 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=dQVt7ZAS3h7P9TWs6MRywImntPzLi7vWjCeWqczW/dg=; b=vRtPLaqq11XecAmTHq2dlcBEu/g6yqdBioRszoAaLNULFSMb19oU7qqGZT+5RLT0dTCl/s lSFUCG69b9+dF7PAvMR/seI8n+VXJUKB8Ske1TiNs6BC6TJryS8nzrbdYPEonTxhj3cNZ0 ragBTYGG3uSYLX6fMD7g+XhiJe7VIdI= 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 7CF96138E2; Tue, 29 Aug 2023 07:27:41 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id D1wLHu2d7WQRHAAAMHmgww (envelope-from ); Tue, 29 Aug 2023 07:27:41 +0000 Date: Tue, 29 Aug 2023 09:27:41 +0200 From: Michal Hocko To: Waiman Long Cc: Yosry Ahmed , Shakeel Butt , Andrew Morton , Johannes Weiner , Roman Gushchin , Muchun Song , Ivan Babrou , Tejun Heo , linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/3] mm: memcg: use non-unified stats flushing for userspace reads Message-ID: References: <599b167c-deaf-4b92-aa8b-5767b8608483@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <599b167c-deaf-4b92-aa8b-5767b8608483@redhat.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 28-08-23 13:27:23, Waiman Long wrote: > > On 8/28/23 13:07, Yosry Ahmed wrote: > > > > > Here I agree with you. Let's go with the approach which is easy to > > > undo for now. Though I prefer the new explicit interface for flushing, > > > that step would be very hard to undo. Let's reevaluate if the proposed > > > approach shows negative impact on production traffic and I think > > > Cloudflare folks can give us the results soon. > > Do you prefer we also switch to using a mutex (with preemption > > disabled) to avoid the scenario Michal described where flushers give > > up the lock and sleep resulting in an unbounded wait time in the worst > > case? > > Locking with mutex with preemption disabled is an oxymoron. I believe Yosry wanted to disable preemption _after_ the lock is taken to reduce the time spent while it is held. The idea to use the mutex is to reduce spinning and more importantly to get rid of lock dropping part. It is not really clear (but unlikely) we can drop it while preserving the spinlock as the thing scales with O(#cgroups x #cpus) in the worst case. -- Michal Hocko SUSE Labs