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 X-Spam-Level: X-Spam-Status: No, score=-7.1 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3579DC433E2 for ; Fri, 17 Jul 2020 05:34:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 10872206BE for ; Fri, 17 Jul 2020 05:34:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="yuTxGWFX" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726798AbgGQFe1 (ORCPT ); Fri, 17 Jul 2020 01:34:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726056AbgGQFe0 (ORCPT ); Fri, 17 Jul 2020 01:34:26 -0400 Received: from mail-lj1-x243.google.com (mail-lj1-x243.google.com [IPv6:2a00:1450:4864:20::243]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 528B7C061755 for ; Thu, 16 Jul 2020 22:34:26 -0700 (PDT) Received: by mail-lj1-x243.google.com with SMTP id s9so11207492ljm.11 for ; Thu, 16 Jul 2020 22:34:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=zWAhdSodPBqi2H5JBOy9sRuP2bwibuSZHD7FBC1gg6E=; b=yuTxGWFXIZNclTVHW9RjLUKJiO7NML3Kg9ysqGYkCZzgOzySzsu+afs7DiEe8YQIyq j6i9gcuRSFaYeo4vSt77AO22/v6He7q1IzbaNZDBW/0MVVw6PvGmvp3vO+Y4BhlnxBVT 7fvggj/uO7ypPmVBTBvu1NFeSXI8ntvUYvbE+vnI0rQYJZcvpF2bvB7lR7NqY34b85yn LlT62FJRHL5juMiyrjPf7uW0a629izRxRCq7xshGd4WUmZ+R+zKGsKAAUDbewb+jbIo5 pnTJoMm3gEh06sV14/Xg9ypmD2utGpnb1ohoq2s3j4ABVsAWpKmSX+TTHRcxA3W6Za9V 9RLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=zWAhdSodPBqi2H5JBOy9sRuP2bwibuSZHD7FBC1gg6E=; b=BKCgxQYo94gl9Bw93jiYcz8SP2vKFJGHut67IW4TRBbtUa0lBC2wv9zKilLjCAsfIc cvgXTQHaVZO1fMiZqwyGlvOxc14TPb73HLttzCUQ1j9/yBN2d24tYFezKL48YdNhbTtF 8RDdAF1Ji1V+887vO8D/exhvcuvzpVwemWBCwdlwWfom3tOTWi3nuSiEB+B8V544+rPW +RCUhaQSbivtwwavLHsXI4UZwQ/fwk6rITr01od5OR35RvpVDWuFYcwaoVkVY/MVNPZM JNsQqteTOdO7xzL0Wrg5O5l00ya6R1WwKeLEGWcC/XWv93sJvyWdTWQTnr7b843nrqe5 0uIg== X-Gm-Message-State: AOAM533+kN6mWaZ3IITkiJsXyCKks+gGLm918i/5U1ho+15+sxvlQAub 3ZJ/BgTwxuSYGp2oyxZD6IRMFJuXcELZQbITM24jTA== X-Google-Smtp-Source: ABdhPJzqUmHupuN7xBd1VTvCVu4k5dno0l+c/2WmOWFAQ4OBBksSBPxWrHIfCMe/SzKgL2Kj8mCltIWrhIYwmLvoT/I= X-Received: by 2002:a2e:b88c:: with SMTP id r12mr3686377ljp.266.1594964064687; Thu, 16 Jul 2020 22:34:24 -0700 (PDT) MIME-Version: 1.0 References: <20200623174037.3951353-1-guro@fb.com> <20200623174037.3951353-9-guro@fb.com> <20200716200744.GB13387@carbon.dhcp.thefacebook.com> In-Reply-To: <20200716200744.GB13387@carbon.dhcp.thefacebook.com> From: Naresh Kamboju Date: Fri, 17 Jul 2020 11:04:13 +0530 Message-ID: Subject: Re: [PATCH v7 08/19] mm: memcg/slab: save obj_cgroup for non-root slab objects To: Roman Gushchin Cc: linux-mips@vger.kernel.org, Andrew Morton , Christoph Lameter , Johannes Weiner , Michal Hocko , Shakeel Butt , linux-mm , Vlastimil Babka , Kernel Team , open list , lkft-triage@lists.linaro.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 17 Jul 2020 at 01:38, Roman Gushchin wrote: > > On Thu, Jul 16, 2020 at 10:25:01PM +0530, Naresh Kamboju wrote: > > On Tue, 23 Jun 2020 at 23:11, Roman Gushchin wrote: > > > > > > Store the obj_cgroup pointer in the corresponding place of > > > page->obj_cgroups for each allocated non-root slab object. Make sure that > > > each allocated object holds a reference to obj_cgroup. > > > > > > Objcg pointer is obtained from the memcg->objcg dereferencing in > > > memcg_kmem_get_cache() and passed from pre_alloc_hook to post_alloc_hook. > > > Then in case of successful allocation(s) it's getting stored in the > > > page->obj_cgroups vector. > > > > > > The objcg obtaining part look a bit bulky now, but it will be simplified > > > by next commits in the series. > > > > > > Signed-off-by: Roman Gushchin > > > Reviewed-by: Vlastimil Babka > > > Reviewed-by: Shakeel Butt > > > --- > > > include/linux/memcontrol.h | 3 +- > > > mm/memcontrol.c | 14 +++++++-- > > > mm/slab.c | 18 +++++++----- > > > mm/slab.h | 60 ++++++++++++++++++++++++++++++++++---- > > > mm/slub.c | 14 +++++---- > > > 5 files changed, 88 insertions(+), 21 deletions(-) > > > > > > > I am not sure if this is the related patch or not that is causing > > mips architecture build failure on linux -next. > > Hello, Naresh! > > Thank you for the report, interesting... > There is nothing arch-specific in the code, so there must be something > compiler-dependent. My wild guess is that the problem is caused by a memory > allocation from the memcg_slab_post_alloc_hook(), but it's added by a later > patch in the series. So if it really fails at this patch, there must be something > different. I'll try to reproduce it, but I have to install the MIPS toolchain first, > so it might take some time. If it creates some troubles, can you, please, check > if s/__always_inline/inline helps? sed -i -e 's#__always_inline#inline#g' mm/slub.c ->> then builds fine. - Naresh 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 X-Spam-Level: X-Spam-Status: No, score=-5.5 required=3.0 tests=BAYES_00,DATE_IN_PAST_03_06, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 582FDC433DF for ; Fri, 17 Jul 2020 08:49:14 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1635920691 for ; Fri, 17 Jul 2020 08:49:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="yuTxGWFX" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1635920691 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id AF9826B002F; Fri, 17 Jul 2020 04:49:13 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AA8186B0030; Fri, 17 Jul 2020 04:49:13 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9E5316B0031; Fri, 17 Jul 2020 04:49:13 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0205.hostedemail.com [216.40.44.205]) by kanga.kvack.org (Postfix) with ESMTP id 8D6166B002F for ; Fri, 17 Jul 2020 04:49:13 -0400 (EDT) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 4A5081803309C for ; Fri, 17 Jul 2020 08:49:13 +0000 (UTC) X-FDA: 77046943386.18.yard88_06045ff26f09 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin18.hostedemail.com (Postfix) with ESMTP id BA9B51005F215 for ; Fri, 17 Jul 2020 08:48:51 +0000 (UTC) X-HE-Tag: yard88_06045ff26f09 X-Filterd-Recvd-Size: 5230 Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by imf49.hostedemail.com (Postfix) with ESMTP for ; Fri, 17 Jul 2020 08:48:51 +0000 (UTC) Received: by mail-wr1-f66.google.com with SMTP id a6so10164984wrm.4 for ; Fri, 17 Jul 2020 01:48:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=zWAhdSodPBqi2H5JBOy9sRuP2bwibuSZHD7FBC1gg6E=; b=yuTxGWFXIZNclTVHW9RjLUKJiO7NML3Kg9ysqGYkCZzgOzySzsu+afs7DiEe8YQIyq j6i9gcuRSFaYeo4vSt77AO22/v6He7q1IzbaNZDBW/0MVVw6PvGmvp3vO+Y4BhlnxBVT 7fvggj/uO7ypPmVBTBvu1NFeSXI8ntvUYvbE+vnI0rQYJZcvpF2bvB7lR7NqY34b85yn LlT62FJRHL5juMiyrjPf7uW0a629izRxRCq7xshGd4WUmZ+R+zKGsKAAUDbewb+jbIo5 pnTJoMm3gEh06sV14/Xg9ypmD2utGpnb1ohoq2s3j4ABVsAWpKmSX+TTHRcxA3W6Za9V 9RLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=zWAhdSodPBqi2H5JBOy9sRuP2bwibuSZHD7FBC1gg6E=; b=RXzQ6nQaQlVTSQdNcdf995lDtmI86b0EFk3ooDdfwdzf0B+UFKpv1goRKhElGF22/N 1+rNr9WaXEuSu1jweeDPNToPR8fPfSkfK6uRkHzT4ImZtq1vbvbMnaUkuBsW0R9sjYMI 0ovr/Cz0kV2nw9kXNXjzQPOgKfWjHXXQq5AoVZsoben3/5v/48g10rDn5faM53BcV0vU aXdDpjIQbWBKux7ob4u/zLukRjTmOKsGtpOcaOJ7N87eFA4S22Mf1DW/PCehLEV9mUaZ ZeAHNCwW6ncAm9DOykaXsBQHjOLQKnSxl4bzgWQiCZaJTHuiyb3WD+/H0xB5LnPsvOYa jwpA== X-Gm-Message-State: AOAM531UPUpdALccqm5KEXXD0+rm2KuK7Nm9wZAD+r0w9xG6i/4UNzvk bCUMFikx8dMprmtSzY8eDd6ZxrTTwfla+yorkslP0qseolqthg== X-Google-Smtp-Source: ABdhPJzqUmHupuN7xBd1VTvCVu4k5dno0l+c/2WmOWFAQ4OBBksSBPxWrHIfCMe/SzKgL2Kj8mCltIWrhIYwmLvoT/I= X-Received: by 2002:a2e:b88c:: with SMTP id r12mr3686377ljp.266.1594964064687; Thu, 16 Jul 2020 22:34:24 -0700 (PDT) MIME-Version: 1.0 References: <20200623174037.3951353-1-guro@fb.com> <20200623174037.3951353-9-guro@fb.com> <20200716200744.GB13387@carbon.dhcp.thefacebook.com> In-Reply-To: <20200716200744.GB13387@carbon.dhcp.thefacebook.com> From: Naresh Kamboju Date: Fri, 17 Jul 2020 11:04:13 +0530 Message-ID: Subject: Re: [PATCH v7 08/19] mm: memcg/slab: save obj_cgroup for non-root slab objects To: Roman Gushchin Cc: linux-mips@vger.kernel.org, Andrew Morton , Christoph Lameter , Johannes Weiner , Michal Hocko , Shakeel Butt , linux-mm , Vlastimil Babka , Kernel Team , open list , lkft-triage@lists.linaro.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: BA9B51005F215 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam02 X-Bogosity: Ham, tests=bogofilter, spamicity=0.074786, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, 17 Jul 2020 at 01:38, Roman Gushchin wrote: > > On Thu, Jul 16, 2020 at 10:25:01PM +0530, Naresh Kamboju wrote: > > On Tue, 23 Jun 2020 at 23:11, Roman Gushchin wrote: > > > > > > Store the obj_cgroup pointer in the corresponding place of > > > page->obj_cgroups for each allocated non-root slab object. Make sure that > > > each allocated object holds a reference to obj_cgroup. > > > > > > Objcg pointer is obtained from the memcg->objcg dereferencing in > > > memcg_kmem_get_cache() and passed from pre_alloc_hook to post_alloc_hook. > > > Then in case of successful allocation(s) it's getting stored in the > > > page->obj_cgroups vector. > > > > > > The objcg obtaining part look a bit bulky now, but it will be simplified > > > by next commits in the series. > > > > > > Signed-off-by: Roman Gushchin > > > Reviewed-by: Vlastimil Babka > > > Reviewed-by: Shakeel Butt > > > --- > > > include/linux/memcontrol.h | 3 +- > > > mm/memcontrol.c | 14 +++++++-- > > > mm/slab.c | 18 +++++++----- > > > mm/slab.h | 60 ++++++++++++++++++++++++++++++++++---- > > > mm/slub.c | 14 +++++---- > > > 5 files changed, 88 insertions(+), 21 deletions(-) > > > > > > > I am not sure if this is the related patch or not that is causing > > mips architecture build failure on linux -next. > > Hello, Naresh! > > Thank you for the report, interesting... > There is nothing arch-specific in the code, so there must be something > compiler-dependent. My wild guess is that the problem is caused by a memory > allocation from the memcg_slab_post_alloc_hook(), but it's added by a later > patch in the series. So if it really fails at this patch, there must be something > different. I'll try to reproduce it, but I have to install the MIPS toolchain first, > so it might take some time. If it creates some troubles, can you, please, check > if s/__always_inline/inline helps? sed -i -e 's#__always_inline#inline#g' mm/slub.c ->> then builds fine. - Naresh