Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3820729rdg; Wed, 18 Oct 2023 07:05:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFOgy5xEUMuecDkwK8NlYuTByY/+QjkAUlQiErNf/L5Rn81LQVWUF/RhENDiF2c+TpbC/W/ X-Received: by 2002:a17:902:8218:b0:1c4:72c9:64ef with SMTP id x24-20020a170902821800b001c472c964efmr5047355pln.40.1697637954215; Wed, 18 Oct 2023 07:05:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697637954; cv=none; d=google.com; s=arc-20160816; b=p/Mv7VXDXsdMpL9K7/5dj1mddHVsy22NSqhTqK/ZdCnulVSul+OR6jTzBIDpfgqi0S ozFTBpspvsBKCzdaxxJ+Tg0HFi6vdH1178p0/0dZdAIYGmzHtWq3frharcRd0babXC0N N8q3q/Dq/HWi3M8D5/GssuRa48OeWnei0LXU863zZD5ilK+gl/f3SoO7eTvshcOWTVyE f+CirfmONJm0xZ6+KyEJ9TpxxCLb4YT9n8N+YnFB7LhleQrzWcepWL3SlHFe9dTZ94/T cMAHMAH2lkVwJNVwU0j2QmRa5iUKCyWqzkHezKlYFYK0dc8CvpYWL+0HxV+tQZC3pV2k XNqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature:dkim-signature; bh=SsQxhsXnIr7Z2WAF9+fEfFsGy8r27zDk+QEwu45RAUk=; fh=U5SkAGn1qfNByPwg14tOLIRF4CpLMn60cHINjkyz8JQ=; b=XHSJDj/iQYQpceRtXCSt6xbPC+iOnntNN77gIATJO2kccOOtdnuyu+dS+fUpk94zTU y1+KMWGFX8YPiMOKJJ9+Rf8p+xdO5iY7EcRT/tEC+ZzCUqcuQK3QmNGQHybeTXrTkSiI d4x9eaSI6ApMrrBFD2E8n8P3FAS+075yaH/irWq3h2kYJ3LQnsqD0FY+7QNjRjby3JoY 2vCdNP4XiJKZdOzW+/BP6ym8VodmkFFQs7Y/CA0qt6XYSBbxrafijwIR3FWE4Anix3ln rYHY+wgp1vMB6NRIvVJ1z0ETq0IB56+O/YruaMQY4W++/s1pCIRGZPibnG2F2vsg5P4s 37JQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b="sejrAI/b"; dkim=neutral (no key) header.i=@suse.cz header.b=BK+welAk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id u14-20020a17090341ce00b001c39f2b4d2bsi4612665ple.438.2023.10.18.07.05.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 07:05:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b="sejrAI/b"; dkim=neutral (no key) header.i=@suse.cz header.b=BK+welAk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id E252780784CB; Wed, 18 Oct 2023 07:05:12 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344804AbjJROFH (ORCPT + 99 others); Wed, 18 Oct 2023 10:05:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231839AbjJROFF (ORCPT ); Wed, 18 Oct 2023 10:05:05 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3131DFA; Wed, 18 Oct 2023 07:05:02 -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 6910B1F37E; Wed, 18 Oct 2023 14:05:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1697637900; 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=SsQxhsXnIr7Z2WAF9+fEfFsGy8r27zDk+QEwu45RAUk=; b=sejrAI/b+RIgxvnafZx2UdISVWeL4WV4kK2U0+73bXZmNEFuf97rkRxmhJNb18Kl1WVy2f 62gnNaKpLr/yKnh/ajACEPKdOeki4gwyUy3uHkk2fDnePOFhIsbge9nL3MciNrxwzuvroj y3eEGo2OXOqIG5ZJ512UIlKLWvqfKAQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1697637900; 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=SsQxhsXnIr7Z2WAF9+fEfFsGy8r27zDk+QEwu45RAUk=; b=BK+welAkUKNdlp0QjigqX8KEnJeqAMCwSQ5RmlN6vlFGv1tGoX7YdfTPO0us9cKgD5v397 VtdaZvTOdWS1pXDQ== 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 2F0DF13915; Wed, 18 Oct 2023 14:05:00 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id XqHnCgzmL2VUTAAAMHmgww (envelope-from ); Wed, 18 Oct 2023 14:05:00 +0000 Message-ID: <549f20e0-d0d7-b379-6725-4f76dddcd6fc@suse.cz> Date: Wed, 18 Oct 2023 16:04:59 +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 4/5] mm: kmem: scoped objcg protection Content-Language: en-US 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-5-roman.gushchin@linux.dev> From: Vlastimil Babka In-Reply-To: <20231016221900.4031141-5-roman.gushchin@linux.dev> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Authentication-Results: smtp-out2.suse.de; none X-Spam-Level: X-Spam-Score: -5.99 X-Spamd-Result: default: False [-5.99 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; BAYES_HAM(-1.89)[94.38%]; 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)[] X-Spam-Status: No, score=-4.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Wed, 18 Oct 2023 07:05:13 -0700 (PDT) On 10/17/23 00:18, Roman Gushchin wrote: > Switch to a scope-based protection of the objcg pointer on slab/kmem > allocation paths. Instead of using the get_() semantics in the > pre-allocation hook and put the reference afterwards, let's rely > on the fact that objcg is pinned by the scope. > > It's possible because: > 1) if the objcg is received from the current task struct, the task is > keeping a reference to the objcg. > 2) if the objcg is received from an active memcg (remote charging), > the memcg is pinned by the scope and has a reference to the > corresponding objcg. > > Signed-off-by: Roman Gushchin (Cruise) > Tested-by: Naresh Kamboju > Acked-by: Shakeel Butt Reviewed-by: Vlastimil Babka