Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp764860ybb; Wed, 1 Apr 2020 09:12:30 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuNbpLpEwfSbbHM2dAqWR9p++HJusYmLZ4H26Kpn8ywJbS7i1HrMV10LI1Z/fTnExTKcE5V X-Received: by 2002:a9d:7488:: with SMTP id t8mr16881159otk.219.1585757549883; Wed, 01 Apr 2020 09:12:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585757549; cv=none; d=google.com; s=arc-20160816; b=uxF8VzgAGALOGAcsOZEY8xbRWflty8CcJcS8bkdZp0rEHdXjBVEYvfjHdapzc8BLkV RJsAviEiMRHgt0Lq5Z0j6qxAvvvMsxU6XpsfNP5TdEDsYlYBXJHDBy4KWlbqhxRDmVPV aRDWhAINddKoutTOOur8/bwtd/QAQbY0Sz7dFAHmgeJxrx4MglJsmXV8+3MSR2zbuoVk 6RbMr1anplLXFyhdULZ1FR4vXxVBwvcKJeclYEngz1mX3ll7h/GTLcGjRKOujLfZf3aw Pc895K6Wqjg3ZVN+5MLNwcrXKudtaFWUmStCwufy5f4QEeImWJVq7sybh4QujoxwL46C fm0w== 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:dkim-signature; bh=uokiotoiiXWiPxukwvDObNN9ROwuv4dXFLRcVdokIVo=; b=rGnv+q7sHaZzjRwQ/8xfmYGveDdQc/7ZajFJ9yAx3SzGHiz7DJk6L0C91xbRCD7PHr KUNFGgkqnCbWqKu67SUEqn1p00LyLnabtwI/eJZT8JnKPF+/BUjS0D+dpZOcrinhRQa4 hubGLvRWM9xyYu80psWB18+ucvT6KrFeowqIDfhj0T1MI/MwtNYCP4a6kdv9biqxaqOE tm20CGID5NDZV3LYsjSu7l+UkMfv2BWAzgMdThZ2re15GWT2Jx+kQ5YLiIxRGJLYW+up XZPGp+4g1AfyxQkizpHsieay+BAd4rtd9nHV1Z1OGRYMkHb4+H46KiAZFO8RDjMR2YRE zNWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=WnPmI+js; 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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v108si934514otb.136.2020.04.01.09.12.16; Wed, 01 Apr 2020 09:12:29 -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; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=WnPmI+js; 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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732336AbgDAQJe (ORCPT + 99 others); Wed, 1 Apr 2020 12:09:34 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:40936 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726612AbgDAQJe (ORCPT ); Wed, 1 Apr 2020 12:09:34 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 031FvVZF104391; Wed, 1 Apr 2020 16:09:12 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2020-01-29; bh=uokiotoiiXWiPxukwvDObNN9ROwuv4dXFLRcVdokIVo=; b=WnPmI+jsoel6+/wdc22Os+HQPbmpAMD2BOghBRdAyQpo+hcvM57fs1mI5In2nCRGwpLC WF0IL50sKla9Ue17E26DW3LFtWaxRM+AwIhDkbVovtUa8yj1csdF10GyjroMzbaENxFP S5Hk+6n8J5XASyjd5ulhURBTYcdBJrW05dGNCWUWSCd+8y6psLpk/EUa50PQ4yijVb+m jM1VIqSvgj9dPhty1SRAPWEr8Fx1VSmn+LqelKIeFimO+KuZAH+EpXr/OE6kBLYWTtkc sUD5gzU3AkH2adOdexpF8uhx57MWnXZ4wSg2GGC0vu6inGArMPCFdds+RQ416aF22Cbx cA== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by userp2130.oracle.com with ESMTP id 303cev6dhf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 01 Apr 2020 16:09:12 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 031G72EK180154; Wed, 1 Apr 2020 16:09:12 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userp3030.oracle.com with ESMTP id 302g2gw0vx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 01 Apr 2020 16:09:12 +0000 Received: from abhmp0009.oracle.com (abhmp0009.oracle.com [141.146.116.15]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 031G9A9I001656; Wed, 1 Apr 2020 16:09:10 GMT Received: from ca-dmjordan1.us.oracle.com (/10.211.9.48) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 01 Apr 2020 09:09:10 -0700 Date: Wed, 1 Apr 2020 12:09:29 -0400 From: Daniel Jordan To: Michal Hocko Cc: David Hildenbrand , Shile Zhang , Andrew Morton , Kirill Tkhai , Pavel Tatashin , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] mm: fix tick timer stall during deferred page init Message-ID: <20200401160929.jwekhr24tb44odea@ca-dmjordan1.us.oracle.com> References: <20200311123848.118638-1-shile.zhang@linux.alibaba.com> <20200401154217.GQ22681@dhcp22.suse.cz> <20200401160048.GU22681@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200401160048.GU22681@dhcp22.suse.cz> User-Agent: NeoMutt/20180716 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9578 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 spamscore=0 mlxscore=0 adultscore=0 phishscore=0 bulkscore=0 suspectscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004010139 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9578 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 adultscore=0 clxscore=1015 phishscore=0 lowpriorityscore=0 spamscore=0 malwarescore=0 suspectscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004010138 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 01, 2020 at 06:00:48PM +0200, Michal Hocko wrote: > On Wed 01-04-20 17:50:22, David Hildenbrand wrote: > > On 01.04.20 17:42, Michal Hocko wrote: > > > I am sorry but I have completely missed this patch. > > > > > > On Wed 11-03-20 20:38:48, Shile Zhang wrote: > > >> When 'CONFIG_DEFERRED_STRUCT_PAGE_INIT' is set, 'pgdatinit' kthread will > > >> initialise the deferred pages with local interrupts disabled. It is > > >> introduced by commit 3a2d7fa8a3d5 ("mm: disable interrupts while > > >> initializing deferred pages"). > > >> > > >> On machine with NCPUS <= 2, the 'pgdatinit' kthread could be bound to > > >> the boot CPU, which could caused the tick timer long time stall, system > > >> jiffies not be updated in time. > > >> > > >> The dmesg shown that: > > >> > > >> [ 0.197975] node 0 initialised, 32170688 pages in 1ms > > >> > > >> Obviously, 1ms is unreasonable. > > >> > > >> Now, fix it by restore in the pending interrupts for every 32*1204 pages > > >> (128MB) initialized, give the chance to update the systemd jiffies. > > >> The reasonable demsg shown likes: > > >> > > >> [ 1.069306] node 0 initialised, 32203456 pages in 894ms > > >> > > >> Fixes: 3a2d7fa8a3d5 ("mm: disable interrupts while initializing deferred pages"). > > > > > > I dislike this solution TBH. It effectivelly conserves the current code > > > and just works around the problem. Why do we hold the IRQ lock here in > > > the first place? This is an early init code and a very limited code is > > > running at this stage. Certainly nothing memory hotplug related which > > > should be the only path really interested in the resize lock AFAIR. > > > > Yeah, I don't think ACPI and friends are up yet. > > Just to save somebody time to check. The deferred initialization blocks > the further boot until all workders are done - see page_alloc_init_late > (kernel_init path). Ha, I just finished following all the hotplug paths to check this out, and as you all know there are a *lot* :-) Well at least we're in agreement. > > > This needs a double checking but I strongly believe that the lock can be > > > simply dropped in this path. This is what my fix does, it limits the time the resize lock is held.