Received: by 10.213.65.68 with SMTP id h4csp440935imn; Tue, 13 Mar 2018 09:08:14 -0700 (PDT) X-Google-Smtp-Source: AG47ELtGzx2VoTSZ5eLY2orKl1Wdjd/ZGALb/SEInFgvTIS3px373BGcO5QjUsdY2A5Hu/UiVYtV X-Received: by 10.99.152.68 with SMTP id l4mr897335pgo.75.1520957294751; Tue, 13 Mar 2018 09:08:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520957294; cv=none; d=google.com; s=arc-20160816; b=W04fr8T0bDH0XStuXXCrWZPR6RMH1NnsTi3BxrIWBk0iOVRl+pa36Rz+Rx1imPtErq tBmxwJ/+evr8fXviPjvUWF6asblvM8ML74wUukaM2niohRPC71tAtUpXfe/+ZaoTVCcI wlpZxLzE7wcqzjZ+qi+kZQfvtRps7OVnhCYiggugINZ+JKyXE4xq5M5UURVkeoyDQ4wP 2GKC5dhDv1dnsezhcePTFyljqCeQuaYGvJgf44Rff6MKx3JK+4vGKrtaOGjetUtJZ8Yd NqMiMcA3GdhysB5s90KQDxLhV2OJYnEDE3aYh23beQE9CmBQ3UIg1slS217Fht7hRYdZ mxrQ== 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:arc-authentication-results; bh=+IxSHH//GNji7n/8e4W9+4jzaIAIlLXYwTvChBpI10c=; b=mRginP6RRDwelOABZWJxxFmItexF71wq7NTieFE0La7u4cB8r27L0+1f4WyG5op1K1 J6btKMYOH+uaSFnyXkImDtaqYtXQKYQ9RPfuLdrqsWTF0REayqYfHjMrkFh+KeUopzpQ Kb5wDCxuEA2L6Lcb5pEuDFeSp8zFzCb7j+q+bbF999pDaeNAgdIX3Kvo4aAyUOOeI+zH VGffpKfHCYct9cZRTFF4FLtwUI8dJuISpie+RFmoIqJPICSe5h9NHnS2JhOuuiENyU3v DfRWBaoseOLXMCt4c81yvsSaxasMIeRvB+ql+jnUYbnsXM87IzoENVsttKTEb1avqh0k WSQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=oZHjlezZ; 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 y86si351981pfi.19.2018.03.13.09.08.00; Tue, 13 Mar 2018 09:08:14 -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-2017-10-26 header.b=oZHjlezZ; 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 S934336AbeCMQFx (ORCPT + 99 others); Tue, 13 Mar 2018 12:05:53 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:37352 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934168AbeCMQFg (ORCPT ); Tue, 13 Mar 2018 12:05:36 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w2DG2RKW141200; Tue, 13 Mar 2018 16:04:46 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-2017-10-26; bh=+IxSHH//GNji7n/8e4W9+4jzaIAIlLXYwTvChBpI10c=; b=oZHjlezZATIBbO6tGlYEX18gHPiInGnKgUlgCgy19OxM51PMGrUpANkKmgkOQIEfL4ca uacaawsT4ui4HvhmcBv45+11o9f/C1kYrmHQg9BL0S0otzEPdygoyg1PFAm/gNjyINlf shFRyRCufcJoA7finMKO5EedjJD8JKQxp5726DbFLhK3zYyGH5CQL8+//W0u4xmJ1JED s2uf2oqyMH+Jkloq/Q5k9EpBsVxElUBlOVZHNwqyX/tBKIx/aR9Vxd/UsND6GU3yePrF 3aOziqtg60A1cArgwCtFL/kijEpRN+5nh2n901e79/X9qldLyz8uzU4zfrmn7n6PTAF1 gw== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2120.oracle.com with ESMTP id 2gph6tr8f9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 13 Mar 2018 16:04:46 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w2DG4gcU025490 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 13 Mar 2018 16:04:42 GMT Received: from abhmp0016.oracle.com (abhmp0016.oracle.com [141.146.116.22]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w2DG4YgE023458; Tue, 13 Mar 2018 16:04:34 GMT Received: from xakep.localdomain (/10.39.223.236) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 13 Mar 2018 09:04:34 -0700 Date: Tue, 13 Mar 2018 12:04:30 -0400 From: Pavel Tatashin To: Andrew Morton Cc: steven.sistare@oracle.com, daniel.m.jordan@oracle.com, m.mizuma@jp.fujitsu.com, mhocko@suse.com, catalin.marinas@arm.com, takahiro.akashi@linaro.org, gi-oh.kim@profitbricks.com, heiko.carstens@de.ibm.com, baiyaowei@cmss.chinamobile.com, richard.weiyang@gmail.com, paul.burton@mips.com, miles.chen@mediatek.com, vbabka@suse.cz, mgorman@suse.de, hannes@cmpxchg.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [v5 1/2] mm: disable interrupts while initializing deferred pages Message-ID: <20180313160430.hbjnyiazadt3jwa6@xakep.localdomain> References: <20180309220807.24961-1-pasha.tatashin@oracle.com> <20180309220807.24961-2-pasha.tatashin@oracle.com> <20180312130410.e2fce8e5e38bc2086c7fd924@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180312130410.e2fce8e5e38bc2086c7fd924@linux-foundation.org> User-Agent: NeoMutt/20171215 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8831 signatures=668690 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=2 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=780 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1803130187 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Andrew, > > +/* Disable interrupts and save previous IRQ state in flags before locking */ > > +static inline > > +void pgdat_resize_lock_irq(struct pglist_data *pgdat, unsigned long *flags) > > +{ > > + unsigned long tmp_flags; > > + > > + local_irq_save(*flags); > > + local_irq_disable(); > > + pgdat_resize_lock(pgdat, &tmp_flags); > > +} > > As far as I can tell, this ugly-looking thing is identical to > pgdat_resize_lock(). I will get rid of it, and use pgdat_resize_lock(). My confusion was that I thought that local_irq_save() only saves the IRQ flags does not disable them. > > > --- a/mm/page_alloc.c > > +++ b/mm/page_alloc.c > > @@ -1506,7 +1506,6 @@ static void __init deferred_free_pages(int nid, int zid, unsigned long pfn, > > } else if (!(pfn & nr_pgmask)) { > > deferred_free_range(pfn - nr_free, nr_free); > > nr_free = 1; > > - cond_resched(); > > } else { > > nr_free++; > > And how can we simply remove these cond_resched()s? I assume this is > being done because interrupts are now disabled? But those were there > for a reason, weren't they? We must remove cond_resched() because we can't sleep anymore. They were added to fight NMI timeouts, so I will replace them with touch_nmi_watchdog() in a follow-up fix. Thank you for your review, Pavel