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 50165C41535 for ; Tue, 20 Dec 2022 21:15:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233789AbiLTVPb (ORCPT ); Tue, 20 Dec 2022 16:15:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45520 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234048AbiLTVP0 (ORCPT ); Tue, 20 Dec 2022 16:15:26 -0500 Received: from out2.migadu.com (out2.migadu.com [IPv6:2001:41d0:2:aacc::]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BCFE11EAEB; Tue, 20 Dec 2022 13:15:23 -0800 (PST) Date: Tue, 20 Dec 2022 13:15:16 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1671570922; h=from:from:reply-to:subject:subject: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=YR2G1tfnt1QeRb9BvoQh2xZ0Hit39TayrVYxM23Ti5o=; b=cBJO2EIe6oiGh2ENr1dP4PUWluxLFCOQnl1rnqFwsqvzqef+3Rd/UJmBPLbq5IL4/dcQEn gN4B8V37nJGryYOHvpTd23Gf5nrA6ZTRW9dEdQKd/He/k9s9kK8CV0Agq/XwjtfIEVbjoQ ujr36SB+a8Yw8C6daF2iwukLgcHSDDY= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Roman Gushchin To: Shakeel Butt Cc: linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, Johannes Weiner , Michal Hocko , Muchun Song , Andrew Morton Subject: Re: [PATCH RFC 1/2] mm: kmem: optimize get_obj_cgroup_from_current() Message-ID: References: <20221220182745.1903540-1-roman.gushchin@linux.dev> <20221220182745.1903540-2-roman.gushchin@linux.dev> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 20, 2022 at 11:55:34AM -0800, Shakeel Butt wrote: > On Tue, Dec 20, 2022 at 10:28 AM Roman Gushchin > wrote: > > > > Manually inline memcg_kmem_bypass() and active_memcg() to speed up > > get_obj_cgroup_from_current() by avoiding duplicate in_task() checks > > and active_memcg() readings. > > > > Also add a likely() macro to __get_obj_cgroup_from_memcg(): > > obj_cgroup_tryget() should succeed at almost all times except > > a very unlikely race with the memcg deletion path. > > > > Signed-off-by: Roman Gushchin > > Can you please add your performance experiment setup and result of > this patch in the commit description of this patch as well? Sure. I used a small hack to just do a bunch of allocations in a raw and measured the time. Will include it into the commit message. Also will fix the #ifdef thing from the second patch, thanks for spotting it. > > Acked-by: Shakeel Butt Thank you for taking a look!