Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3506477yba; Mon, 29 Apr 2019 03:42:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqw6TbZ7vOFitGBs+fVPVQGM+4gYIGqE6PWyiN7UOGbPaT2VF3Qka6AvN4luM96hgvMbUm70 X-Received: by 2002:a63:e406:: with SMTP id a6mr554323pgi.132.1556534559070; Mon, 29 Apr 2019 03:42:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556534559; cv=none; d=google.com; s=arc-20160816; b=ZwT+xmzn+9wFy4zcfQQ8y5ELpTNB9BCzsU2fXqnrpSSlnvHrS+soxAKq5HtpoMJhtp 82wVNjUEi+odlS7gM+gyb8SrOcJ3WnOI+euoq3CBpx0LqSJAV6oa3oARJUY+eCiKWQgw IGBp6M/5wJ4EBuCINbPd/LmFty0cdB591OMxmb/tsiyLTYaMLttmWFLNwoPTaAowpjvv 9M9djuAlf3jw1G1H463xtx975EaktQ0aavjTahL8YKgxnQzij0iiIJMtaVVlBfHtNBoi dmgCd9UPQSv1LJopCIpKEsusyGFOiUSrLfZeYaguVYXhSGexsEzPptuezCMr9g2XBmny B2IQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=SFjYUUJZ1VP6zEyJ8XuuNiaAX0L5ImNaXO8eQtgJxYA=; b=ZYKHR+qzG934HoyxRjVCWLlR40gJcMvjCO8SyPyeQyIdaWD5pf0y9xO+Ag+Erjgj5u KWg+n5l8tKS4jG6Ghjibar8sBW1c7d+8Ve+6FeHocQmSiSFlMAWZ1c+11CXzIzwhZv+G MS2AehXEOVRXRc52SN4U7beCh/hXsbaJ86SOu56ZnWAmo2TjmChDrx4x7/tp9Oa9WUAT Dysfict33DNfZtyA8X21SQQsMER8AeiC3G56NaoQlBTgrWASp68XT3GnmyPlVJMAhoXO UunXtjjHaGyByyyxa88LiI+5Xts/Fmrr+o4d/8mTYZwO20pHSX20PBJ+bWxBn5gEgAz9 PUjA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a13si31145464pgh.139.2019.04.29.03.42.23; Mon, 29 Apr 2019 03:42:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727775AbfD2Kk5 (ORCPT + 99 others); Mon, 29 Apr 2019 06:40:57 -0400 Received: from mx2.suse.de ([195.135.220.15]:36982 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727560AbfD2Kk5 (ORCPT ); Mon, 29 Apr 2019 06:40:57 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 25CCFAB9D; Mon, 29 Apr 2019 10:40:56 +0000 (UTC) Date: Mon, 29 Apr 2019 12:40:51 +0200 From: Michal Hocko To: Jiri Slaby Cc: Johannes Weiner , Vladimir Davydov , cgroups@vger.kernel.org, mm , Linux kernel mailing list Subject: Re: memcg causes crashes in list_lru_add Message-ID: <20190429104051.GF21837@dhcp22.suse.cz> References: <2cbfb8dc-31f0-7b95-8a93-954edb859cd8@suse.cz> <359d98e6-044a-7686-8522-bdd2489e9456@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <359d98e6-044a-7686-8522-bdd2489e9456@suse.cz> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 29-04-19 12:09:53, Jiri Slaby wrote: > On 29. 04. 19, 11:25, Jiri Slaby wrote:> memcg_update_all_list_lrus > should take care about resizing the array. > > It should, but: > [ 0.058362] Number of physical nodes 2 > [ 0.058366] Skipping disabled node 0 > > So this should be the real fix: > --- linux-5.0-stable1.orig/mm/list_lru.c > +++ linux-5.0-stable1/mm/list_lru.c > @@ -37,11 +37,12 @@ static int lru_shrinker_id(struct list_l > > static inline bool list_lru_memcg_aware(struct list_lru *lru) > { > - /* > - * This needs node 0 to be always present, even > - * in the systems supporting sparse numa ids. > - */ > - return !!lru->node[0].memcg_lrus; > + int i; > + > + for_each_online_node(i) > + return !!lru->node[i].memcg_lrus; > + > + return false; > } > > static inline struct list_lru_one * > > > > > > Opinions? Please report upstream. This code here is there for quite some time. I do not really remember why we do have an assumption about node 0 and why it hasn't been problem until now. Thanks! -- Michal Hocko SUSE Labs