Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp2955761lqt; Tue, 23 Apr 2024 06:50:00 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX+QNDIJVhlg1Bx9XazFjAmlOURfjRcHvFPu0lNLNC4d+y2ml5qYG6J760Y8SokgZ4v8gid6kFR6CcYZI1ssTb1XYduvkmGjCIovuTHJQ== X-Google-Smtp-Source: AGHT+IHH9p35YVwoKVdTcqBwISOZ0qiApvcwKLKFjzFmnd0ZLTbl01uxXJqfjH9eM5GPt3OsaMKR X-Received: by 2002:a50:a41d:0:b0:571:b82f:630d with SMTP id u29-20020a50a41d000000b00571b82f630dmr2987999edb.0.1713880200474; Tue, 23 Apr 2024 06:50:00 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713880200; cv=pass; d=google.com; s=arc-20160816; b=vMJzdyu64l0kMb5wuCyMmATxDcYevn9jhca6HVC9pQESG/HoV4IwLpNJaD6Gh3sKEQ Lb4rRg1MgYHvU+IDumsO8o357/IpVPcpQoazEnlEPQOZ9lKEefLD/3ZbLcaiatk+X5Nm IWABgOqnH2YnOjKSgxy7HLOX3nVx532/wLPMzwvC30svxfnqhN3qmJNmxznCyDVVkv6B CHW20IzDetXEkR8zA490h9loDf9eyw5hvxG0V2PSwhX2x/o+6Wr/yQpKz7T4qlfL6U0Q ojNPuLI0JfoMPx2OQewV0j0QUVdm3c4WIWOsx249PiBhZyK6shSQ8lKYsalWIgO1vMfb EbkQ== 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=54otsI6UoDqq+k+Xp9PPa5eDRRf1d2Mx1uUAtmPc1nE=; fh=02mzdBHDwVU3cKLXe44dTpz/lNtSI/OnLkQNQlNC8oA=; b=G8pwGTseBb9/5bDgmpCEJGg9Vvbz7b91dH55By+O2YSGiDj4F4pY15YKmsd0p20uKX wp1SojROsJisQUzH4F2nKr14xCVyVJjGET5d3c7XuX2o8M+lYQQpN28xYVXZPtDRARvN KpFhY9hGp83BVLTfSl3ZYyPS9q7F3epBfa+gJby2xy0Y/PecsT9jRhN6xb/vKW3Gy1aa cISIBLADZpuTQ9Xo9bpuSFP36Tf+XVxFc1usLGJBAm2mDExmsj6ZQCAFH598w8LEVou5 E2D6hE0hyc5UUMb33R52aGeJplNq9Zd52BB+Lre42gTzsV09zJf9nMD27I4hEkDz3SG+ UeKQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=uWi7oEC1; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=v7xoW3W8; 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-155308-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-155308-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id b34-20020a509f25000000b0056e6acb4249si7177230edf.328.2024.04.23.06.50.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Apr 2024 06:50:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-155308-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=uWi7oEC1; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=v7xoW3W8; 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-155308-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-155308-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 1A94A1F2462E for ; Tue, 23 Apr 2024 13:49:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6C16C136E11; Tue, 23 Apr 2024 13:49:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="uWi7oEC1"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="bfeC/poB"; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="v7xoW3W8"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="ecrfcJ4o" 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 7BA1518E28; Tue, 23 Apr 2024 13:49:31 +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=1713880174; cv=none; b=POb0TGc5hWaG0PMvobsTXEYtf31zQgnES8hY+OgC9qZlzWH5S25IVIfdO7NQUA2m75Brmky8ycp3/kSqN4+yKkkVoLChwtUT3ijUU17xdo87lhRxYHmo9XZysfwP+lWMiC/smXGUhqCQFna6mMi5DmSxY3bVwH1A91mDfLtNb3w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713880174; c=relaxed/simple; bh=NhKe2YHGl5ISjIZ1V9kL7vfU+zEcRpuhapiZo1nEUQk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=rZKwxxrj2PFQ2cTAfTGr+rn/ibBZy/NHqRrn55otcrq2+n1lSxnWVZidSEripEm87CgBj+B1OaTZq8ZfS+sy21vU8diQPWjF7DwKYCxV2MrUnHrrvmhwwg3hy/HMWqXpbYSGJULedb+cagp4hGGiw+ZeFNHKxy5XYYv6OjD6eTg= 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=uWi7oEC1; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=bfeC/poB; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=v7xoW3W8; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=ecrfcJ4o; 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 [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 5ACC25FFCA; Tue, 23 Apr 2024 13:49:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1713880169; 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=54otsI6UoDqq+k+Xp9PPa5eDRRf1d2Mx1uUAtmPc1nE=; b=uWi7oEC1LjmnzCwJirxtgcLddCwnd9NotMB8y7eRO9J9kGaDCe+rOmCjEVCVg9h2cjw5Yk msPVQj2z5TreO/tsDdFzjqCDU0iWfxRnmwjUPY9Q/410gWvVz2tuHA0C8JM29HQB5yfgK5 uSCCtyBJxJJbAu29AGHnGnrt9b1zs0c= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1713880169; 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=54otsI6UoDqq+k+Xp9PPa5eDRRf1d2Mx1uUAtmPc1nE=; b=bfeC/poBWxtSr94p6O5hAG6FYErmI0upu0VH1RgrY+qoBJ3dvgUGfZewJKznCz9Pr8tymr TEGg2403KrLE1nDg== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1713880168; 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=54otsI6UoDqq+k+Xp9PPa5eDRRf1d2Mx1uUAtmPc1nE=; b=v7xoW3W8AAYjvlxIVXWQwGqud55udGK5f1upOXiEuBsyvkRJpUn15V4gmfENMwNiMGT8Qh /Nb3uDQNCzaqz4cEcaRi0gxiCTTsFGnxkkj8aK/6SKm1Gu2Yq0qH7s3JZ+0Rs+lro4KD47 nF4SYUQqwVgHQ9w5XnKhGmb2+FcYAVY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1713880168; 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=54otsI6UoDqq+k+Xp9PPa5eDRRf1d2Mx1uUAtmPc1nE=; b=ecrfcJ4oxak7KaLj9A+5Cxr6ZMfddeMazoCRfrPaFrX5pqCcxyG7XQUDCghu1zJyaObgRn JFouHs3ce8B7nWCQ== 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 4161C13929; Tue, 23 Apr 2024 13:49:28 +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 AB2mD2i8J2ahbwAAD6G6ig (envelope-from ); Tue, 23 Apr 2024 13:49:28 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id DF70BA082F; Tue, 23 Apr 2024 15:49:23 +0200 (CEST) Date: Tue, 23 Apr 2024 15:49:23 +0200 From: Jan Kara To: Xiu Jianfeng Cc: viro@zeniv.linux.org.uk, brauner@kernel.org, jack@suse.cz, tj@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: <20240423134923.osuljlalsd27awz3@quack3> References: <20240420094428.1028477-1-xiujianfeng@huawei.com> 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: <20240420094428.1028477-1-xiujianfeng@huawei.com> X-Spam-Level: X-Spamd-Result: default: False [-3.80 / 50.00]; BAYES_HAM(-3.00)[99.98%]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_RHS_NOT_FQDN(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; MISSING_XM_UA(0.00)[]; RCPT_COUNT_TWELVE(0.00)[16]; RCVD_COUNT_THREE(0.00)[3]; FROM_HAS_DN(0.00)[]; DKIM_SIGNED(0.00)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; FROM_EQ_ENVFROM(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; RCVD_TLS_LAST(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns,suse.com:email,huawei.com:email,suse.cz:email] X-Spam-Score: -3.80 X-Spam-Flag: NO 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 One style nit below: > +/* > + * css_is_online - test whether the specified css is online > + * @css: target css > + */ > +static inline bool css_is_online(struct cgroup_subsys_state *css) > +{ > + return !!(css->flags & CSS_ONLINE); > +} Since the return type is 'bool', you don't need the !! magic in the statement above. Honza -- Jan Kara SUSE Labs, CR