Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp7131pxk; Tue, 15 Sep 2020 18:19:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyI53XNDuIX8qfgjDPBmkUTvkwY16xmCNCbS6IYWFkvuQsr3WEVa9SvPWxmSp6Usf3MU6px X-Received: by 2002:a17:906:f9d3:: with SMTP id lj19mr22639019ejb.346.1600219168299; Tue, 15 Sep 2020 18:19:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600219168; cv=none; d=google.com; s=arc-20160816; b=Hx2d/Q4KeO7NHM5Fyi1WhsMLyuxyNN/vLpn5e3LvvXRRHLrM5AYaU4AOJ7Yl5hPnYY OksRoAkif/Fk6My+M4rYzmn00RfWHfu2lTvLUw0JT/W+GRd2mzdfjita4UY6FrfdIUe+ UFuGsCVWdLugw2QhwZGt9JYf2e33ooR+bsEtgV/2SZ7O+RjECdhmedVMtk1FIEhKFpry rkMuEi9Pd1QtA1FCu3UXiwXYs6lfl2NBYy3KuDRmIPsFIuNrPOI/iftXZBnngVfOoMIq n2LEEhRmtgIJilTtdICUlpVJ3NdQUtlAol0jt2nzuAGc8kcQTkZtIl53M6KWgGoitZ6t tLPw== 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:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=RiOrC8XeC2cd1tk/0se0POnH5wvCLSvx3bLl8nQ9uwM=; b=O2B05MXO+DvztWO7xuvkaH0d0brtEN/jZVWBPhDD2qObJ04qkPz/SGmR0XAPaIs1y6 xwzirt5M/WZo4KTvs+wGerG1VvxlDlrIhPBhacdxeZec+jrOF0Ks4AzKNog8g/31Mcy3 NFoKa+OgR9hRfHmz8fhX6UGz1XjC2t8bqPO8A2ncB6jKjAE3h/8fpf4x1VvE4x9ufhnT 7DlUk+ZhdjX7FbtCdapj/s+4nD9MZdZdTpbJkzFt0BRbpNUoxR4MUfIEGpPH8lX+wIua gMXBuO1AD/xOU+YVWW0RTWpJnTbgiPHXLnF5HaJmjp6V5idYBMso08ABikRaJOzoWppZ Ugog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=vEGWVXqW; 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 e3si11687226edj.131.2020.09.15.18.19.05; Tue, 15 Sep 2020 18:19:28 -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; dkim=pass header.i=@kernel.org header.s=default header.b=vEGWVXqW; 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 S1726140AbgIPBRv (ORCPT + 99 others); Tue, 15 Sep 2020 21:17:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:56656 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726061AbgIPBRu (ORCPT ); Tue, 15 Sep 2020 21:17:50 -0400 Received: from X1 (unknown [67.22.170.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 36E8A207DE; Wed, 16 Sep 2020 01:17:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600219070; bh=AhUHdnUo9rJC4ndiU3DPdecCdebXpTSRQ5+5l3tt/Rc=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=vEGWVXqW0XORjvPLXUCTjGJjOkgr3iekyk2VnZoNYdpLT0WSxr3JRDU08fmPZPEH4 m8tnBGaSqBBcFN2q9/IDrD1x/ioYcHzfgW4AglvJmV/ua9/OxpTY19TdcArFzozl5U 1WymYuFrqxY+zfNdSrFzPllVgfWmmRn7zZrkylTw= Date: Tue, 15 Sep 2020 18:17:49 -0700 From: Andrew Morton To: Cc: , Subject: Re: [PATCH] mm/page_alloc.c: avoid inheritting current's flags when invoked in interrupt Message-Id: <20200915181749.2bb7420e2c7e62267b21a0fc@linux-foundation.org> In-Reply-To: <20200915075635.1112-1-yanfei.xu@windriver.com> References: <20200915075635.1112-1-yanfei.xu@windriver.com> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 15 Sep 2020 15:56:35 +0800 wrote: > From: Yanfei Xu > > alloc_mask shouldn't inherit the current task's flags when > __alloc_pages_nodemask is invoked in interrupt. > > ... > > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -4889,7 +4889,8 @@ __alloc_pages_nodemask(gfp_t gfp_mask, unsigned int order, int preferred_nid, > * from a particular context which has been marked by > * memalloc_no{fs,io}_{save,restore}. > */ > - alloc_mask = current_gfp_context(gfp_mask); > + if (!in_interrupt()) > + alloc_mask = current_gfp_context(gfp_mask); > ac.spread_dirty_pages = false; > > /* hm, yes, and perhaps other callsites in page_alloc.c. I assume this doesn't actually make any runtime difference? Because gfp_mask in interrupt contexts isn't going to have __GFP_IO or __GFP_FS anyway.