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 C650FC77B6D for ; Thu, 30 Mar 2023 08:15:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229463AbjC3IPE (ORCPT ); Thu, 30 Mar 2023 04:15:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55692 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229470AbjC3IPD (ORCPT ); Thu, 30 Mar 2023 04:15:03 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BBB4940CA; Thu, 30 Mar 2023 01:15:01 -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-out2.suse.de (Postfix) with ESMTPS id 617961FEA1; Thu, 30 Mar 2023 08:15:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1680164100; 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=L+5wWM9KaM83E2/8g4jR2hxUBs15iqyGGbyguGgqv6E=; b=Zkm382DuV3cURAzt/IiQ9KAhrZxaXTxTdveLwdBMtYHpoE8u1K6ciaYaQMSNkGJ/omClUo iIcdekBvIAUYIuqAzCDRW3IXFkKXanegH0ZMMprE+/Z1xVDp1l90YBKnyajEOetGF/rKfL 5FdD/y8rIiefom+dXeppIrIHiFQKcfg= 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 3EC03138FF; Thu, 30 Mar 2023 08:15:00 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id Ip3yDARFJWTAEAAAMHmgww (envelope-from ); Thu, 30 Mar 2023 08:15:00 +0000 Date: Thu, 30 Mar 2023 10:14:59 +0200 From: Michal Hocko To: Yosry Ahmed Cc: Johannes Weiner , Shakeel Butt , Tejun Heo , Josef Bacik , Jens Axboe , Zefan Li , Roman Gushchin , Muchun Song , Andrew Morton , Michal =?iso-8859-1?Q?Koutn=FD?= , Vasily Averin , cgroups@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, bpf@vger.kernel.org Subject: Re: [PATCH v2 4/9] cgroup: rstat: add WARN_ON_ONCE() if flushing outside task context Message-ID: References: <20230328221644.803272-1-yosryahmed@google.com> <20230328221644.803272-5-yosryahmed@google.com> <20230329192059.2nlme5ubshzdbpg6@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: bpf@vger.kernel.org On Thu 30-03-23 01:06:26, Yosry Ahmed wrote: [...] > If we achieve that, do you think it makes sense to add > WARN_ON_ONCE(irqs_disabled()) instead to prevent future users from > flushing while disabling irqs or in irq context? WARN_ON (similar to BUG_ON) will not prevent anybody from doing bad things. We already have means to shout about sleepable code being invoked from an atomic context and there is no reason to duplicate that. As I've said earlier WARN_ON might panic the system in some configurations (and yes they are used also in production systems - do not ask me why...). So please be careful about that and use that only when something really bad (yet recoverable) is going on. -- Michal Hocko SUSE Labs