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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id DDA3FC433EF for ; Wed, 15 Dec 2021 04:37:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3BF196B0071; Tue, 14 Dec 2021 23:37:20 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 36DC06B0073; Tue, 14 Dec 2021 23:37:20 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 235986B0074; Tue, 14 Dec 2021 23:37:20 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0217.hostedemail.com [216.40.44.217]) by kanga.kvack.org (Postfix) with ESMTP id 1306A6B0071 for ; Tue, 14 Dec 2021 23:37:20 -0500 (EST) Received: from smtpin31.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id B8D9F8249980 for ; Wed, 15 Dec 2021 04:37:09 +0000 (UTC) X-FDA: 78918768978.31.8BD5BCA Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf08.hostedemail.com (Postfix) with ESMTP id D52F6160014 for ; Wed, 15 Dec 2021 04:37:05 +0000 (UTC) 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-out2.suse.de (Postfix) with ESMTPS id B68D31F383; Wed, 15 Dec 2021 04:37:07 +0000 (UTC) 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 C9D73139CF; Wed, 15 Dec 2021 04:37:04 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id eHemJvBwuWF8aQAAMHmgww (envelope-from ); Wed, 15 Dec 2021 04:37:04 +0000 Date: Tue, 14 Dec 2021 20:36:57 -0800 From: Davidlohr Bueso To: Waiman Long Cc: Johannes Weiner , Michal Hocko , Vladimir Davydov , Andrew Morton , linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, linux-mm@kvack.org, Sebastian Andrzej Siewior , Thomas Gleixner Subject: Re: [PATCH-next v3] mm/memcg: Properly handle memcg_stock access for PREEMPT_RT Message-ID: <20211215043657.ngmxlk6rgc2ysbmz@offworld> Mail-Followup-To: Waiman Long , Johannes Weiner , Michal Hocko , Vladimir Davydov , Andrew Morton , linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, linux-mm@kvack.org, Sebastian Andrzej Siewior , Thomas Gleixner References: <20211214144412.447035-1-longman@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20211214144412.447035-1-longman@redhat.com> User-Agent: NeoMutt/20201120 X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: D52F6160014 X-Stat-Signature: s4p8963oc9unm8twzx9anaiizpghakcr Authentication-Results: imf08.hostedemail.com; dkim=none; spf=softfail (imf08.hostedemail.com: 195.135.220.29 is neither permitted nor denied by domain of dave@stgolabs.net) smtp.mailfrom=dave@stgolabs.net; dmarc=none X-HE-Tag: 1639543025-218973 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue, 14 Dec 2021, Waiman Long wrote: >@@ -2189,7 +2194,7 @@ static void drain_local_stock(struct work_struct *dummy) > * drain_stock races is that we always operate on local CPU stock > * here with IRQ disabled > */ >- local_irq_save(flags); >+ local_lock_irqsave(&memcg_stock.lock, flags); > > stock = this_cpu_ptr(&memcg_stock); > drain_obj_stock(&stock->irq_obj); So here there is still the problem that you can end up taking sleeping locks with irqs disabled via obj_cgroup_put() >> obj_cgroup_release() - ie: the percpu_ref_switch_lock and css_set_lock. It had occurred to me to promote the former to a raw spinlock, but doubt we can get away with the latter. Thanks, Davidlohr