Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp164626pxf; Tue, 30 Mar 2021 23:26:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwfOglCECpAQ+SLyuqflrWQiV8Ftp7r8fBGD9ziOdivb/CQPzzPqhRmanHbeyeK07ezM07v X-Received: by 2002:a17:907:e88:: with SMTP id ho8mr1891137ejc.199.1617171995629; Tue, 30 Mar 2021 23:26:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617171995; cv=none; d=google.com; s=arc-20160816; b=LxxBaNduoEOynMGECfTly4mj16QsDQK0hqTEIh7CKrKM3NwvlCQhWeb5eFZzPi66lp YR2yyvo7yDRC+xTO0YOB6/SnMNM3K4y1UVUZD4GK7ySsioNib1Wn1JY+hBr8unjWLv/i S9YyVX3wRqJlbXJCilYeEioIOimkT6qYlqrQw5WVHDb9qdmQmL19DKsLJyRuZFip34WV 8Kb4XT8l0ce9fJeWfCWzH00WH1tTpCo27MOyQvi6kohIH2IwPmm6rVXcOtIW2slnQ0rL F3zaltlY2QLwus70foblIFCQW34Fv2u5nifNFuCbSsYN7BFgVxm4nRtKJZoxQKu18rnT 2ekA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:dkim-signature; bh=ds9KDQE0lURuBbFdLw1dQMkw99BbaLkohL6SI1Cl21g=; b=CVjg+I+17buvAEy+J9pddXFkGreEouTY7QI67ThZzFH476SLrM7kwuO84SikqwXCv2 iehaBpzUvDdRapXFQ+LeN+VEATqtSLiH03SR3OBphFoXD3ezf7rl+z1itcfbKSexUxXM u5SK8k3WT9+pi5RtljAqmi1xxaelO+seHqYnO+NByDj3J4rJIqx8X2j/j7TewqmbLR9s EEYOlqNJXJegsBmQJqCW+xgOZ8NTN9jgfl5Tc93nZekhV889gOsb97kFt1qjgoY2TY1d Ofrd9LPJHYl2Z5wDgcHupyckoJF7jnflJrmBmEjiyvbSIVcczuiYy1j51YslU5Ig5WVJ sLJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=VJMW9Ned; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bi21si1083405edb.439.2021.03.30.23.26.12; Tue, 30 Mar 2021 23:26:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=VJMW9Ned; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233754AbhCaGXK (ORCPT + 99 others); Wed, 31 Mar 2021 02:23:10 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:25540 "EHLO mx0b-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233793AbhCaGW7 (ORCPT ); Wed, 31 Mar 2021 02:22:59 -0400 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 12V64HqZ155610; Wed, 31 Mar 2021 02:22:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding : subject; s=pp1; bh=ds9KDQE0lURuBbFdLw1dQMkw99BbaLkohL6SI1Cl21g=; b=VJMW9NedmnMPKVag38WKKJ0k3sr5yW0G4vdeE86ZNa+kbQsJAUoBBJzFff4FREBRzkwH c8fQ2UhHt6EDMvHqZQaYFLNP2tgqXvJV6H/F+h4IMykeNvSAEU5zKS+JN5JygBK4aipb 9OaEB2uJ1OAIj6X1pAnarmg5el13SXUGUNrAw5p84Q6lEqiPgUk+KE+W+jTGVP9jwDjv JHYLRCDaRWV4SyGDk1j6T8OFElGSt1EFH4DMfqktmhrmkUu8KrkyQRTXXVxmXWsAgRLE JWunD0I3JSrb55TPnIcIoW3Yk1LdZrMh62jv66ZIjXMBDGuSf0T3M9ajlkzF296dXuWP 5Q== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 37mb3h386m-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 31 Mar 2021 02:22:47 -0400 Received: from m0098417.ppops.net (m0098417.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 12V64llQ160083; Wed, 31 Mar 2021 02:22:46 -0400 Received: from ppma04fra.de.ibm.com (6a.4a.5195.ip4.static.sl-reverse.com [149.81.74.106]) by mx0a-001b2d01.pphosted.com with ESMTP id 37mb3h3860-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 31 Mar 2021 02:22:46 -0400 Received: from pps.filterd (ppma04fra.de.ibm.com [127.0.0.1]) by ppma04fra.de.ibm.com (8.16.0.43/8.16.0.43) with SMTP id 12V6MfmC015951; Wed, 31 Mar 2021 06:22:45 GMT Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by ppma04fra.de.ibm.com with ESMTP id 37maaxr5vx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 31 Mar 2021 06:22:44 +0000 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 12V6MgOu27263308 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 31 Mar 2021 06:22:42 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A52984C052; Wed, 31 Mar 2021 06:22:42 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C5B3F4C050; Wed, 31 Mar 2021 06:22:41 +0000 (GMT) Received: from oc7455500831.ibm.com (unknown [9.171.8.136]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 31 Mar 2021 06:22:41 +0000 (GMT) To: Muchun Song Cc: Stephen Rothwell , Linux Next Mailing List , Yang Shi , Andrew Morton , Linux Kernel Mailing List , linux-s390 , Johannes Weiner , Michal Hocko , Roman Gushchin , Shakeel Butt , Vladimir Davydov , Xiongchun Duan References: <20210329205249.6b557510@canb.auug.org.au> <83263d0d-1f3f-8a3c-8a95-49e0cfa15051@de.ibm.com> <4419611b-3282-2197-884c-332025cdada8@de.ibm.com> <7c27fc2e-5cea-5a17-6e30-8ae1cb291274@de.ibm.com> From: Christian Borntraeger Message-ID: <179f84ad-7b98-4bc5-f895-c19faabbb311@de.ibm.com> Date: Wed, 31 Mar 2021 08:22:41 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: 7pEnv20s5T29mufr_NapfYxYJrxN59G3 X-Proofpoint-GUID: 8EQFTOGSlE-CQ_rgiN5HG6yhJL7u3mzX Subject: RE: kernel warning percpu ref in obj_cgroup_release X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.369,18.0.761 definitions=2021-03-31_01:2021-03-30,2021-03-31 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 spamscore=0 mlxscore=0 phishscore=0 malwarescore=0 bulkscore=0 lowpriorityscore=0 suspectscore=0 clxscore=1015 adultscore=0 impostorscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2103300000 definitions=main-2103310045 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 30.03.21 18:25, Muchun Song wrote: > On Tue, Mar 30, 2021 at 11:10 PM Christian Borntraeger > wrote: >> >> >> On 30.03.21 15:49, Muchun Song wrote: >>> On Tue, Mar 30, 2021 at 9:27 PM Christian Borntraeger >>> wrote: >>>> >>>> So bisect shows this for belows warning: >>> >>> Thanks for your effort on this. Can you share your config? >> >> attached (but its s390x) for next-20210330 > > Thanks. Can you apply the following patch and help me test? > Very Thanks. > > diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h > index 7fdc92e1983e..579408e4d46f 100644 > --- a/include/linux/memcontrol.h > +++ b/include/linux/memcontrol.h > @@ -793,6 +793,12 @@ static inline void obj_cgroup_get(struct obj_cgroup *objcg) > percpu_ref_get(&objcg->refcnt); > } > > +static inline void obj_cgroup_get_many(struct obj_cgroup *objcg, > + unsigned long nr) > +{ > + percpu_ref_get_many(&objcg->refcnt, nr); > +} > + > static inline void obj_cgroup_put(struct obj_cgroup *objcg) > { > percpu_ref_put(&objcg->refcnt); > diff --git a/mm/memcontrol.c b/mm/memcontrol.c > index c0b83a396299..1634dba1044c 100644 > --- a/mm/memcontrol.c > +++ b/mm/memcontrol.c > @@ -3133,7 +3133,10 @@ void split_page_memcg(struct page *head, unsigned int nr) > > for (i = 1; i < nr; i++) > head[i].memcg_data = head->memcg_data; > - css_get_many(&memcg->css, nr - 1); > + if (PageMemcgKmem(head)) > + obj_cgroup_get_many(__page_objcg(head), nr - 1); > + else > + css_get_many(&memcg->css, nr - 1); > } > > #ifdef CONFIG_MEMCG_SWAP > This one seems to do the trick, I can no longer see the warning.