Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp61518lqd; Tue, 23 Apr 2024 14:50:21 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWAdBU+fJmtlBdoMXGcI2H1v/0zsAhP37bNQjVxZ5AfJvy6aGMriSK4IPW5nbdX4CRM8Z2ST2CKfho5BX9UfoxECHHaWTQiCZUcJ9H/Lg== X-Google-Smtp-Source: AGHT+IGD20dDZ2aQs0O5gtMDcwEay5Khz4f0k36lxGWmXkS25NoJHTnKzm6a7KCnJIY7e3o/0QJh X-Received: by 2002:a05:6a00:815:b0:6ec:ebf4:439a with SMTP id m21-20020a056a00081500b006ecebf4439amr986616pfk.5.1713909021191; Tue, 23 Apr 2024 14:50:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713909021; cv=pass; d=google.com; s=arc-20160816; b=MrBOoWTnzfeUIQ6uv6Jik/2+TZV3TOjTwD4G/N9/emlxBKMN/h1/MbrVPnvRgpBylC CO+9Zo+LoOVjgw5EhBfa0U+kHYJxhS61vwLise4gGag3mMYnCIJXthSE93pDqrirI1By 0AnvK6tGt7gJClkfbNf3FATIZorBGpNFFmatwfQgH3vSxqrkAoLHMYeUuQ1VDXoVSiYm sakLSnD14DHwTiP+6nkHvvW/wPck5oQlMEGoZsH69UbsMu4nHdNrDJpMwXSz2j/Zan6e rzZDAde96dLY59U3747xB641XxCvLJk/BUI4zLp3SgjIzjV7hKabcExIYPVO7IZKTkoq pStA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature:dkim-signature:dkim-signature :dkim-signature; bh=YyDric3YYV0XdWbcFJ6RrE+aUMRfuXf3pK3qRnTRTvM=; fh=HNPHI7C1BZO1OxySAsfUyvC9li3ANpOG26b/7BEF22g=; b=ixp06Hh2ozh5JDae+CSojXMKnir52uW6/f1x3Ub84K1kC0/j7VvaCXTdIC6ZVIpvB9 vq5WkD8cYVaKvsvRyXNZeLnQBoxNx/7+vtzKSiAOIiGiGoCOJwtwFe47dl8/Pow/eNQD 7Q/x15HnU+q6Z7TSxAEa5/4sT+ZKvN2RiOf4850J6sgEGxF35R6HSmmX4ufkVFpsghIC s4O6gku1NmIF6bwZQWAE89I9fe9nUAEC1bJtiHZdGKQqamxfSEJ90ZHRx/YU9bWEB3/o aJM1q8Z7FmjY/omCrpGdtjPIb4dErnjA22bx7nbSJtzpmBYBhLSW6kqYsHzBtEJJ41F2 eOZw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=ToSxqQtj; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=ToSxqQtj; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.cz dkim=pass dkdomain=suse.cz dkim=pass dkdomain=suse.cz); spf=pass (google.com: domain of linux-kernel+bounces-155916-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-155916-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id u197-20020a6379ce000000b005d8b313de16si10598981pgc.573.2024.04.23.14.50.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Apr 2024 14:50:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-155916-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=ToSxqQtj; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=ToSxqQtj; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.cz dkim=pass dkdomain=suse.cz dkim=pass dkdomain=suse.cz); spf=pass (google.com: domain of linux-kernel+bounces-155916-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-155916-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 7BF6FB280B2 for ; Tue, 23 Apr 2024 21:19:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EA38814388D; Tue, 23 Apr 2024 21:19:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="ToSxqQtj"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="U/KvoAXA"; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="ToSxqQtj"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="U/KvoAXA" Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D8E34143866; Tue, 23 Apr 2024 21:19:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713907158; cv=none; b=BIGa3kd6lBiPN3qQhUWeXQ/9Dmd8sh+vdlbCgokoEwSX4rcPLI1VBsgn9IyLNAEgsO8j7Rcaoo3Ooha7xSmveAPsxGitr72GQF13Gnxz54SCJpxjtX+boiIPKSsKwlzmZk0wRytiGkhdExZqR9fWZI6wgPBg2INt66XGX1pF5Wc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713907158; c=relaxed/simple; bh=65jyqrzopsOdGYIPlbDKl6wixPGu13rGPdjxvxmGXco=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=fRxmYkb9o4Oo1JZqjrte7DUEyILd8N+G07tyOdsbFhA+d0H8kWYnn/69F3llGSfBVSVYJ034tvSpgnrnFWkeQajAHBPdwkgQzGPZY3gWh6ip4K/TCtV3Z8dwF6zNJIASygeNsCjeNcP5YU/O6MUmYRWtlfFV6KvhwnnauCmZBms= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz; spf=pass smtp.mailfrom=suse.cz; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=ToSxqQtj; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=U/KvoAXA; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=ToSxqQtj; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=U/KvoAXA; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.cz Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 4BEA65CFA9; Tue, 23 Apr 2024 21:19:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1713907148; 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=YyDric3YYV0XdWbcFJ6RrE+aUMRfuXf3pK3qRnTRTvM=; b=ToSxqQtj3qjqU0bq2rO1neq2pAHQh8D/OFN8n4vTSCSguNJokHOIDXy3fqtOFwMW8LpWNh RmRau+vuNWiEg7hdZmjUI1wbNKTnrOWw4PKx1bJz7Qc3R3dJp8Ud3rnZ3lhVTOeLt7Edvc cF1+o98DUrwUBBFFpSK7L3FDh4ehIp0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1713907148; 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=YyDric3YYV0XdWbcFJ6RrE+aUMRfuXf3pK3qRnTRTvM=; b=U/KvoAXAEubNHHWzWLTB8CMknft+2WzOqu2Vcsu0mPVFS6KFCX3+z1DYfYDi4FjnROwXt1 E4ThNzT8M+mCBxBg== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=ToSxqQtj; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b="U/KvoAXA" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1713907148; 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=YyDric3YYV0XdWbcFJ6RrE+aUMRfuXf3pK3qRnTRTvM=; b=ToSxqQtj3qjqU0bq2rO1neq2pAHQh8D/OFN8n4vTSCSguNJokHOIDXy3fqtOFwMW8LpWNh RmRau+vuNWiEg7hdZmjUI1wbNKTnrOWw4PKx1bJz7Qc3R3dJp8Ud3rnZ3lhVTOeLt7Edvc cF1+o98DUrwUBBFFpSK7L3FDh4ehIp0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1713907148; 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=YyDric3YYV0XdWbcFJ6RrE+aUMRfuXf3pK3qRnTRTvM=; b=U/KvoAXAEubNHHWzWLTB8CMknft+2WzOqu2Vcsu0mPVFS6KFCX3+z1DYfYDi4FjnROwXt1 E4ThNzT8M+mCBxBg== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 3CE8213894; Tue, 23 Apr 2024 21:19:08 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id qeOYDswlKGatcQAAD6G6ig (envelope-from ); Tue, 23 Apr 2024 21:19:08 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id E2E0BA082F; Tue, 23 Apr 2024 23:19:03 +0200 (CEST) Date: Tue, 23 Apr 2024 23:19:03 +0200 From: Jan Kara To: Tejun Heo Cc: Jan Kara , Xiu Jianfeng , viro@zeniv.linux.org.uk, brauner@kernel.org, lizefan.x@bytedance.com, hannes@cmpxchg.org, mhocko@kernel.org, roman.gushchin@linux.dev, shakeel.butt@linux.dev, muchun.song@linux.dev, akpm@linux-foundation.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH -next] cgroup: Introduce css_is_online() helper Message-ID: <20240423211903.aofflj5wanozhat7@quack3> References: <20240420094428.1028477-1-xiujianfeng@huawei.com> <20240423134923.osuljlalsd27awz3@quack3> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Level: X-Spamd-Result: default: False [-4.01 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_RHS_NOT_FQDN(0.50)[]; R_DKIM_ALLOW(-0.20)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; MISSING_XM_UA(0.00)[]; RCPT_COUNT_TWELVE(0.00)[16]; MIME_TRACE(0.00)[0:+]; FUZZY_BLOCKED(0.00)[rspamd.com]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:email]; TO_DN_SOME(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DKIM_SIGNED(0.00)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; RCVD_TLS_LAST(0.00)[]; DKIM_TRACE(0.00)[suse.cz:+] X-Rspamd-Action: no action X-Rspamd-Queue-Id: 4BEA65CFA9 X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Spam-Flag: NO X-Spam-Score: -4.01 On Tue 23-04-24 05:56:38, Tejun Heo wrote: > Hello, > > On Tue, Apr 23, 2024 at 03:49:23PM +0200, Jan Kara wrote: > > On Sat 20-04-24 09:44:28, Xiu Jianfeng wrote: > > > Introduce css_is_online() helper to test if whether the specified > > > css is online, avoid testing css.flags with CSS_ONLINE directly > > > outside of cgroup.c. > > > > > > Signed-off-by: Xiu Jianfeng > > > > Looks good. Feel free to add: > > > > Reviewed-by: Jan Kara > > I'm a bit skeptical about these trivial helpers. If the test is something > more involved or has complications which need documentation (e.g. regarding > synchronization and what not), the helper would be useful even if it's just > as a place to centrally document what's going on. However, here, it's just > testing one flag and I'm not sure what benefits the helper brings. Yeah OK. I felt the motivation was so that writeback code doesn't have to peek into cgroup "internals" so I'm fine with the change from writeback POV. But if you don't see the point from cgroup side than sure I'm fine without this change as well. Honza -- Jan Kara SUSE Labs, CR