Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp389185pxk; Wed, 2 Sep 2020 04:27:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx0Gyl3gjxRSD03ZqOIHaHHRfb5CFO08OjS27tUTKJ144Fzpbm/4JFA6UkoAxF30bwMu3/i X-Received: by 2002:a17:906:692:: with SMTP id u18mr5731823ejb.43.1599046049213; Wed, 02 Sep 2020 04:27:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599046049; cv=none; d=google.com; s=arc-20160816; b=O2DVQJTxgHRgZOM/YdRdS6ty3wpEVa8G/krDfjrU/RdTswBEaqNXmzmMYK+69Qvn9o 4VgEkPWiVbh+SKyhR2sSsblRsx6+KiECk685PJqi1I+vt2lg1IHgoT0b4TGCLPJy0rZ+ s/9QXqJB4i4340D1wx1XsANNb9vPp/frkWI9BtESZHlFiN/L+SY4EWn2hHBzNQtj94pI ZsLuV7aLt3ywDvo7jPmdT6yqwFAwaii6Spj8utaRT7CFfy206jGDs1mSp46dVu0ItYPD SDaRHKAqcrd/d9ys8sbMjZ80ep58yu5Sjboq6CfzcEsIEjljcF12wfmjZtE9Ogbl60Bf 3dAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=GJFgjyibcabAkPIadu3Y28DyE+eiqhmbf38/TOxWc/o=; b=p3cyppFO/GZ7sNWdVNHtWWYnJJ3QQCXdG56THp/QaNJneEJjMlsbYCg/4JlVZsaAiy bJtZ05g1I9AlQAekCvb1Vrev3aIHoakTcMRdX4/IV3BvEFmWmJgZpPyoPcbopiSaITcN FTM85Y0F1NiqKyiX7PGjxvz+gqu4Ax/KrvnTB1nZsjP0fJfMzdq3OMgG1XVHo64TrDDt UqzbRbHqwg0UE5x0wX2PJolyw0cGgXsoitvtknW3DHtia1MKIZxvG9jbxEHNUh+94Umt boML3MxgLRsyGl+W3LeN1qL6k21czlWkdm54OT1NczzLvCX3Sp376DYTwzc16UX3Kopy 3awQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g8si2223096edt.584.2020.09.02.04.27.06; Wed, 02 Sep 2020 04:27:29 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726521AbgIBL0a (ORCPT + 99 others); Wed, 2 Sep 2020 07:26:30 -0400 Received: from mx2.suse.de ([195.135.220.15]:43666 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726124AbgIBL01 (ORCPT ); Wed, 2 Sep 2020 07:26:27 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 46DC0B18C; Wed, 2 Sep 2020 11:26:26 +0000 (UTC) Date: Wed, 2 Sep 2020 13:26:24 +0200 From: Michal Hocko To: Vlastimil Babka Cc: Pavel Tatashin , Roman Gushchin , Bharata B Rao , "linux-mm@kvack.org" , Andrew Morton , Johannes Weiner , Shakeel Butt , Vladimir Davydov , "linux-kernel@vger.kernel.org" , Kernel Team , Yafang Shao , stable , Linus Torvalds , Sasha Levin , Greg Kroah-Hartman , David Hildenbrand Subject: Re: [PATCH v2 00/28] The new cgroup slab memory controller Message-ID: <20200902112624.GC4617@dhcp22.suse.cz> References: <20200127173453.2089565-1-guro@fb.com> <20200130020626.GA21973@in.ibm.com> <20200130024135.GA14994@xps.DHCP.thefacebook.com> <20200813000416.GA1592467@carbon.dhcp.thefacebook.com> <6469324e-afa2-18b4-81fb-9e96466c1bf3@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6469324e-afa2-18b4-81fb-9e96466c1bf3@suse.cz> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 02-09-20 11:53:00, Vlastimil Babka wrote: > On 8/28/20 6:47 PM, Pavel Tatashin wrote: > > There appears to be another problem that is related to the > > cgroup_mutex -> mem_hotplug_lock deadlock described above. > > > > In the original deadlock that I described, the workaround is to > > replace crash dump from piping to Linux traditional save to files > > method. However, after trying this workaround, I still observed > > hardware watchdog resets during machine shutdown. > > > > The new problem occurs for the following reason: upon shutdown systemd > > calls a service that hot-removes memory, and if hot-removing fails for > > Why is that hotremove even needed if we're shutting down? Are there any > (virtualization?) platforms where it makes some difference over plain > shutdown/restart? Yes this sounds quite dubious. > > some reason systemd kills that service after timeout. However, systemd > > is never able to kill the service, and we get hardware reset caused by > > watchdog or a hang during shutdown: > > > > Thread #1: memory hot-remove systemd service > > Loops indefinitely, because if there is something still to be migrated > > this loop never terminates. However, this loop can be terminated via > > signal from systemd after timeout. > > __offline_pages() > > do { > > pfn = scan_movable_pages(pfn, end_pfn); > > # Returns 0, meaning there is nothing available to > > # migrate, no page is PageLRU(page) > > ... > > ret = walk_system_ram_range(start_pfn, end_pfn - start_pfn, > > NULL, check_pages_isolated_cb); > > # Returns -EBUSY, meaning there is at least one PFN that > > # still has to be migrated. > > } while (ret); This shouldn't really happen. What does prevent from this to proceed? Did you manage to catch the specific pfn and what is it used for? start_isolate_page_range and scan_movable_pages should fail if there is any memory that cannot be migrated permanently. This is something that we should focus on when debugging. -- Michal Hocko SUSE Labs