Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3445413yba; Mon, 29 Apr 2019 02:27:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqx/XlAvgc/MKrjni3x85Jv+tQ6dcZYcqjX9sqHwNSa2qS2SGJRWQORL8mfySx18P0et3lIg X-Received: by 2002:a62:ed05:: with SMTP id u5mr60642383pfh.63.1556530022443; Mon, 29 Apr 2019 02:27:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556530022; cv=none; d=google.com; s=arc-20160816; b=y+BwwqEh65MZPJMBRDlcNdrZ65KGLmuVHn/cH8pt8exs1mHFS8yYgVNhu1VoGOZOBO G4DghLuHxYXRyvZRfuYk33fcLFjPnN7fMi/tcY/f49FI5dRP58x/5DB1bqzJVGnZOVGD IPngdH7nzAXwe6GG+rI9RExcNswOeTCS1NDmUCgRWSAsgHvJ78FY0HV12z5aebJcjfqT JBLVnVXuctN3bfXDwPdD4z/IiP8zwzXkoR2HfILf8qIsZ2fV0d6mI/9qJ3ylN/INWhZE dH3F4z6xZoLRtPnILv4M6j0n65Eny/cB/XP+dlTHU0YGFW43m/RHs1moRGhWi/c0WT8X C2Hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:openpgp:references:to:from:subject; bh=h3OFNZlc6AsyomiHCZN9csfMCoi5Fu5j7kwL8xvJ/EI=; b=e/3JKuvmnS5QKAm8SkacUz8+oEvpuBkuqHFcH3Iwbqk265AU54ptibZbYz/BYZjmIU p8xle3Xwt9ykJmKbfBc6BoBl7tb8/5SgMazSgnl0L74gs/aOGSVMFGXzwmvrENfQ/i+b 4G5Wzwlqw34aYK7GRipgpafOKC1DLQu+K4mZXu9NADvSmysayYVU+cGF3P4uvnWPrJV3 xwp/Ot8x8JKvaJGntV+zhzqMAN2E3aMk2CClqL9XNhUV8oTL01os+y6QyWbe4GzGoOe7 eb3zB6EdUzUWA2Am4C/zP+nkB1z716oOn77l4ApBW9rRSoWsRKpiP1vZglH0+vYecKBY uBKg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m79si33723874pfi.81.2019.04.29.02.26.47; Mon, 29 Apr 2019 02:27:02 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727734AbfD2JZy (ORCPT + 99 others); Mon, 29 Apr 2019 05:25:54 -0400 Received: from mail-wr1-f46.google.com ([209.85.221.46]:41603 "EHLO mail-wr1-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727072AbfD2JZy (ORCPT ); Mon, 29 Apr 2019 05:25:54 -0400 Received: by mail-wr1-f46.google.com with SMTP id c12so14914224wrt.8; Mon, 29 Apr 2019 02:25:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:references:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=h3OFNZlc6AsyomiHCZN9csfMCoi5Fu5j7kwL8xvJ/EI=; b=HosF3yWORCx/Khe0yKD48YcoxB4HO+er8494Qi3MRt2eQonDH4IxeYGD9Hlc6rmrbs dtasm9Sdcb8eyRCAYxFYOssRd+PMLnArwVkikATyO6c+BsQHlzuR1VjpWAG0uRHSUiX9 UHG7SS6tt+ulPGZkShSyx9u7N0QKNz0wduLFdmrssGtp7gMMGnuYcRHziAV8pyCLwGyw +1pLrgiLfZeqLWsSrI7Xt9EArkpC0EfGT0FJxXRfCaPsm67Ytcu4b9+XRVittz3dxTHP XyKeQ9I5lsrBWvpQNdQ4lFJo+Bb3bb3gUOJbQpQr3ponu/v+kZxhtSJVnbk9LuMaP6gf Mjhg== X-Gm-Message-State: APjAAAVwfEHPSFr4RIyaPgd/OLadWz0SqHN2GIb/KhyRpgcgSBtmC+ns EZIEMLCEmx284E5s33oK+F3IDu4l X-Received: by 2002:a5d:4cd1:: with SMTP id c17mr4819108wrt.231.1556529951489; Mon, 29 Apr 2019 02:25:51 -0700 (PDT) Received: from ?IPv6:2a0b:e7c0:0:107::49? ([2a0b:e7c0:0:107::49]) by smtp.gmail.com with ESMTPSA id v192sm32733168wme.24.2019.04.29.02.25.49 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Mon, 29 Apr 2019 02:25:49 -0700 (PDT) Subject: Re: memcg causes crashes in list_lru_add From: Jiri Slaby To: Johannes Weiner , Michal Hocko , Vladimir Davydov , cgroups@vger.kernel.org, mm , Linux kernel mailing list References: Openpgp: preference=signencrypt Autocrypt: addr=jslaby@suse.cz; prefer-encrypt=mutual; keydata= mQINBE6S54YBEACzzjLwDUbU5elY4GTg/NdotjA0jyyJtYI86wdKraekbNE0bC4zV+ryvH4j rrcDwGs6tFVrAHvdHeIdI07s1iIx5R/ndcHwt4fvI8CL5PzPmn5J+h0WERR5rFprRh6axhOk rSD5CwQl19fm4AJCS6A9GJtOoiLpWn2/IbogPc71jQVrupZYYx51rAaHZ0D2KYK/uhfc6neJ i0WqPlbtIlIrpvWxckucNu6ZwXjFY0f3qIRg3Vqh5QxPkojGsq9tXVFVLEkSVz6FoqCHrUTx wr+aw6qqQVgvT/McQtsI0S66uIkQjzPUrgAEtWUv76rM4ekqL9stHyvTGw0Fjsualwb0Gwdx ReTZzMgheA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3Hs1iMGecPyV XxCVvSV6dwRQFc0UOZ1a6ywwCWfGOYqFnJvfSbUiCMV8bfRSWhnNQYLIuSv/nckyi8CzCYIg c21cfBvnwiSfWLZTTj1oWyj5a0PPgGOdgGoIvVjYXul3yXYeYOqbYjiC5t99JpEeIFupxIGV ciMk6t3pDrq7n7Vi/faqT+c4vnjazJi0UMfYnnAzYBa9+NkfW0w5W9Uy7kW/v7SffH/2yFiK 9HKkJqkN9xYEYaxtfl5pelF8idoxMZpTvCZY7jhnl2IemZCBMs6s338wS12Qro5WEAxV6cjD VSdmcD5l9plhKGLmgVNCTe8DPv81oDn9s0cIRLg9wNnDtj8aIiH8lBHwfUkpn32iv0uMV6Ae sLxhDWfOR4N+wu1gzXWgLel4drkCJcuYK5IL1qaZDcuGR8RPo3jbFO7Y Message-ID: <2cbfb8dc-31f0-7b95-8a93-954edb859cd8@suse.cz> Date: Mon, 29 Apr 2019 11:25:48 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=iso-8859-2 Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 29. 04. 19, 10:16, Jiri Slaby wrote: > Hi, > > with new enough systemd, one of our systems 100% crashes during boot. > Kernels I tried are all affected: 5.1-rc7, 5.0.10 stable, 4.12.14. > > The 5.1-rc7 crash: >> [ 12.022637] systemd[1]: Starting Create list of required static device nodes for the current kernel... >> [ 12.023353] BUG: unable to handle kernel NULL pointer dereference at 0000000000000008 >> [ 12.041502] #PF error: [normal kernel read fault] >> [ 12.041502] PGD 0 P4D 0 >> [ 12.041502] Oops: 0000 [#1] SMP NOPTI >> [ 12.041502] CPU: 0 PID: 208 Comm: (kmod) Not tainted 5.1.0-rc7-1.g04c1966-default #1 openSUSE Tumbleweed (unreleased) >> [ 12.041502] Hardware name: Supermicro H8DSP-8/H8DSP-8, BIOS 080011 06/30/2006 >> [ 12.041502] RIP: 0010:list_lru_add+0x94/0x170 >> [ 12.041502] Code: c6 07 00 66 66 66 90 31 c0 5b 5d 41 5c 41 5d 41 5e 41 5f c3 49 8b 7c 24 20 49 8d 54 24 08 48 85 ff 74 07 e9 46 00 00 00 31 ff <48> 8b 42 08 4c 89 6a 08 49 89 55 00 49 89 45 08 4c 89 28 48 8b 42 >> [ 12.041502] RSP: 0018:ffffb11b8091be50 EFLAGS: 00010202 >> [ 12.041502] RAX: 0000000000000001 RBX: ffff930b35705a40 RCX: ffff9309cf21ade0 >> [ 12.041502] RDX: 0000000000000000 RSI: ffff930ab61bc587 RDI: ffff930a17711000 >> [ 12.041502] RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 >> [ 12.041502] R10: 0000000000000000 R11: 0000000000000008 R12: ffff9309f5f86640 >> [ 12.041502] R13: ffff930ab5705a40 R14: 0000000000000001 R15: ffff930a171dc4e0 >> [ 12.041502] FS: 00007f42d6ea5940(0000) GS:ffff930ab7800000(0000) knlGS:0000000000000000 >> [ 12.041502] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 >> [ 12.041502] CR2: 0000000000000008 CR3: 0000000057dec000 CR4: 00000000000006f0 >> [ 12.041502] Call Trace: >> [ 12.041502] d_lru_add+0x44/0x50 ... > and even makes the beast booting. memcg has very wrong assumptions on > 'memcg_nr_cache_ids'. It does not assume it can change later, despite it > does. ... > I am not sure why this is machine-dependent. I cannot reproduce on any > other box. > > Any idea how to fix this mess? memcg_update_all_list_lrus should take care about resizing the array. So it looks like list_lru_from_memcg_idx returns a stale pointer to list_lru_from_kmem and then to list_lru_add. Still investigating. thanks, -- js suse labs