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 15112CDB483 for ; Wed, 18 Oct 2023 14:12:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344866AbjJROMQ (ORCPT ); Wed, 18 Oct 2023 10:12:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56758 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231933AbjJROME (ORCPT ); Wed, 18 Oct 2023 10:12:04 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F0DB1B3; Wed, 18 Oct 2023 07:11:28 -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 9D3811F37E; Wed, 18 Oct 2023 14:11:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1697638286; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DYiV2GlRsuhLVr+o+u8G875fUeAuZMgyNTvrcWEW7Ls=; b=AH7J6bQ4jRhJuFjlD2XOy2YOXaP7CIeRKCUlEbK3rUc+kl3oEbNyJnsFz7SPY3PW3g9Yg7 ByRaIwmVgsBhmo8lM/kMUVxRR4yuVqr0JLCKlLwCMgBSvHQLSDFrBnC7b009ims80WZaEi a5Ej3LHo3l4op7e1KP20IvmvgFASIww= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1697638286; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DYiV2GlRsuhLVr+o+u8G875fUeAuZMgyNTvrcWEW7Ls=; b=WRceSXZYToTwRmBaTbtGNZwl0FvLc1BeLXgZXwIBNHdOOMU2v5Q/Opy7cB6IuZRynBwhNa 2bo8Ni/IKnUFrYAw== 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 71F3F13915; Wed, 18 Oct 2023 14:11:26 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id /yosG47nL2XATwAAMHmgww (envelope-from ); Wed, 18 Oct 2023 14:11:26 +0000 Message-ID: <30bf8eb7-f039-48cf-3dca-11f99604e12e@suse.cz> Date: Wed, 18 Oct 2023 16:11:26 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH v3 2/5] mm: kmem: add direct objcg pointer to task_struct Content-Language: en-US From: Vlastimil Babka To: Roman Gushchin , Andrew Morton Cc: linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, Johannes Weiner , Michal Hocko , shakeelb@google.com, Muchun Song , Dennis Zhou , David Rientjes , Naresh Kamboju References: <20231016221900.4031141-1-roman.gushchin@linux.dev> <20231016221900.4031141-3-roman.gushchin@linux.dev> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Authentication-Results: smtp-out2.suse.de; none X-Spamd-Result: default: False [-4.76 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; BAYES_HAM(-0.66)[82.76%]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-3.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; DKIM_SIGNED(0.00)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; NEURAL_HAM_SHORT(-1.00)[-1.000]; RCPT_COUNT_SEVEN(0.00)[11]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/18/23 11:52, Vlastimil Babka wrote: >> + >> + return objcg; >> +} >> + >> __always_inline struct obj_cgroup *get_obj_cgroup_from_current(void) >> { >> struct mem_cgroup *memcg; >> @@ -3008,19 +3054,26 @@ __always_inline struct obj_cgroup *get_obj_cgroup_from_current(void) >> >> if (in_task()) { >> memcg = current->active_memcg; >> + if (unlikely(memcg)) >> + goto from_memcg; >> >> - /* Memcg to charge can't be determined. */ >> - if (likely(!memcg) && (!current->mm || (current->flags & PF_KTHREAD))) > The checks for current->mm and PF_KTHREAD seem to be gone completely after > the patch, was that intended and why? And also they are not present in the new flavor that's current_obj_cgroup().