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=-2.5 required=3.0 tests=MAILING_LIST_MULTI,SPF_PASS, USER_AGENT_MUTT autolearn=ham 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 C123AC43219 for ; Mon, 29 Apr 2019 10:43:31 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8B06C20675 for ; Mon, 29 Apr 2019 10:43:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8B06C20675 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 09D1E6B0003; Mon, 29 Apr 2019 06:43:31 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 049886B0006; Mon, 29 Apr 2019 06:43:30 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E548E6B0007; Mon, 29 Apr 2019 06:43:30 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) by kanga.kvack.org (Postfix) with ESMTP id 96FFB6B0003 for ; Mon, 29 Apr 2019 06:43:30 -0400 (EDT) Received: by mail-ed1-f69.google.com with SMTP id n23so1026075edv.9 for ; Mon, 29 Apr 2019 03:43:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:date:from:to :cc:subject:message-id:references:mime-version:content-disposition :in-reply-to:user-agent; bh=yPAqHgLHcEmij8WPte118wLaMPgpUVAlo/nltH8Lk1Q=; b=f550ev2TlIqqoguwXeiOFMVRhJj1YeJ+JcHZPULLcSDtKXmechZInmyx5CBpnM8q2o 2I1maoMTX9DrjeDhYn7IgZ+DsDDvyttxRi5dcRq+hvYEPXLWdEFJ63qDD7KR5b7D6ttK f7Nnu9ByUnc9CNTdQ+mOA6Vi2VJ88Q43+1U57tK08LFgGYTeoAtVuRI1bJ1dp2uHxawc wVMh+ZpaYgklZ1J9HC0n+9gzK6PgUVtqA/rpD5Lm2l+6GiYBPJlrD1btzOT2BOUI4Omj X/87aI1Ps8Ph/DOgWFaHo00zeSdCvazNac1F4ArjGunoNG8SAUElUPOS9oK+7M9K4z47 JofA== X-Original-Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning mhocko@kernel.org does not designate 195.135.220.15 as permitted sender) smtp.mailfrom=mhocko@kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Gm-Message-State: APjAAAW8R3tilz1466pdK0B/ZnfV51UuQFxpd8WAmrv24DiiLBgGB3Ag 1D0aip43STyFMLoZf3+ZNiVvI581wmox8Ql/lPxzdUjZHTrXw629VDGkbnXGmjRP6dZlZJ3hWUO kN09Vz6jlzF/R9ZOaCNkrmtHiXqfW36xh1mcYSzeXbWoxEfzEFV2kZ6XGnau7/xY= X-Received: by 2002:a50:8927:: with SMTP id e36mr16038303ede.54.1556534610140; Mon, 29 Apr 2019 03:43:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqwkErlK+WOicnKkFONrsZKd1BHvwdhwNehGEgibDMQer7Sh6oc4PTGwP2T3upnWM0M+wcr6 X-Received: by 2002:a50:8927:: with SMTP id e36mr16038275ede.54.1556534609522; Mon, 29 Apr 2019 03:43:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556534609; cv=none; d=google.com; s=arc-20160816; b=N8eu06VStGZID9Pt0Yej++Hfn4jToluJuL09YdEf0/f6A0Mbe74wFrdvt/geq4GIU6 rbKPC4WKGrnoIpIx9tLVqxKQ/ArfYh9aks7CD5SUinqAWaqZZVe1fwIUlDX2cPrdgyrm QrNw7OmzaiyuSLr7wOgxkT0lrfharUVHtG7oR8bZMt6ZnsH0meQZXJaIHPu0U6JDEOE9 TU9XQ7xx79btCmnGbKYEGSEGBjGNJARA+QCe5HqeWLYgw1kZwHXzcD85k6FpyqVF261l oHMj6bKCbbHZUTSN+VTa6ARbEHTynC4Uvp+3PD3gJ68uC8u14kaQpeEPk7iduVu2YSxw JSPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date; bh=yPAqHgLHcEmij8WPte118wLaMPgpUVAlo/nltH8Lk1Q=; b=CwicMwMmPQmVuYtRIoc+p85i3ugrsa4vm9p2rbepd2pqZ6wPHRNTeNNVJpx0wBjHjz twrgo7euE0dNWXSANNFxvk3ofvQbUboFM/mnxW+fqu3+L5Yn3QiCgEEc8mIFYoQpCo2m Z0xrzqc+XCmpNbxBAfFPFTAs7BF2W2h+CJRoLhEWVpK/C9BG+WosSW2Gi+oPiXuwynHs 82sBJ/0LRKADajW0ydMuqO3nGpdJvTt+WKLm9y6zj1c952Zm9IdAcV9nb0Vu8kQTB9XI 5VX7JkjYXCrciwgd1fXqqR/AXywqceg6M+Ea48c4NwFXKpGmeoSOH5H4Q7fSL/dBU7El JxKg== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning mhocko@kernel.org does not designate 195.135.220.15 as permitted sender) smtp.mailfrom=mhocko@kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from mx1.suse.de (mx2.suse.de. [195.135.220.15]) by mx.google.com with ESMTPS id p3si9470897edx.236.2019.04.29.03.43.29 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Apr 2019 03:43:29 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning mhocko@kernel.org does not designate 195.135.220.15 as permitted sender) client-ip=195.135.220.15; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning mhocko@kernel.org does not designate 195.135.220.15 as permitted sender) smtp.mailfrom=mhocko@kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 27A74AB9D; Mon, 29 Apr 2019 10:43:29 +0000 (UTC) Date: Mon, 29 Apr 2019 12:43:26 +0200 From: Michal Hocko To: Jiri Slaby Cc: Johannes Weiner , Vladimir Davydov , cgroups@vger.kernel.org, mm , Linux kernel mailing list , Raghavendra K T Subject: Re: memcg causes crashes in list_lru_add Message-ID: <20190429104326.GG21837@dhcp22.suse.cz> References: <2cbfb8dc-31f0-7b95-8a93-954edb859cd8@suse.cz> <359d98e6-044a-7686-8522-bdd2489e9456@suse.cz> <20190429104051.GF21837@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190429104051.GF21837@dhcp22.suse.cz> User-Agent: Mutt/1.10.1 (2018-07-13) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon 29-04-19 12:40:51, Michal Hocko wrote: > 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. Humm, I blame jet-lag. I was convinced that this is an internal email. Sorry about the confusion. Anyway, time to revisit 145949a1387ba. CCed Raghavendra. -- Michal Hocko SUSE Labs