Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp3041891imm; Thu, 24 May 2018 21:50:52 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqphPNwK6mxbT5A0pu9ZWIJtuwLJdl+f6JnecqdCqy0k2v2tfxFJX86RQWrAfgR/XB6+aum X-Received: by 2002:a63:93:: with SMTP id 141-v6mr770708pga.322.1527223852740; Thu, 24 May 2018 21:50:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527223852; cv=none; d=google.com; s=arc-20160816; b=Z8uOb1+Cu0SSc+OA3I1Vh0loHO+9UEgnmptvEi//Wl8qNFFNJJ3bCZWQBr7IKGMTtL gP6pSp+sEjujevkyhAVU3pVzTje14XUYWbaQnqBFHTcbIMpwGKo0Hr0Iu4R/TCXWux/Q vRCbP+c7zJLqt+41d/ZcBO7rK5e1xap+fHXNKA7RPp4NbJpW+IYwNESaLIebtab0DPoz l2YbkrXJph382/kK0qMVYchMGRIbvAMl6Uq9b7IxNtgdKqmIh8eKgH0fB2zRQ8EOt2Pf KhzRPL52r7XFx1pm5c9he/C0lt9MTsNHMeV2Z9uwbkRkQvGx0yNUr0tFLlcuaKTBw9mW CqmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:from:cc:references:to :subject:arc-authentication-results; bh=zSNd/9mPNri6ldpgMU8voxqZul7gcvrFsPSZ6H55C2A=; b=dXWDXpwikeNVKRhmSJJDHnBd2pQ24OFf7sDfYHdBigcKX3aU/H2xK7CYM+oPh5iOt6 DS6UdlcnFWjvWmb48R9NLaB+sx3f7F78C24noxqmKJXlXNTUNSDnygPXG0B3OMArJAZy dHS3JBGdg51XTIV8up432j/UkFCMAVCW9NQF1dK8u4wUPJFgnq2rNn3LG89/v2rhjgPa aJEpDKmbrDtj6Rc7cSG8AqWp6niXK7eNqKESW3SdPwPOABpvFbWj6mlxKoS4GHNmuDlV 7XhzPF8DE24kO75I0StIjomUMyx9GzEZEiYT0qrqLvWUCO7778Yxx9x71rIS9IAwzwWa X3mQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o9-v6si17945161pgp.508.2018.05.24.21.50.37; Thu, 24 May 2018 21:50:52 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935032AbeEYEu2 (ORCPT + 99 others); Fri, 25 May 2018 00:50:28 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:39822 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932557AbeEYEu1 (ORCPT ); Fri, 25 May 2018 00:50:27 -0400 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w4P4hgAd034166 for ; Fri, 25 May 2018 00:50:26 -0400 Received: from e06smtp10.uk.ibm.com (e06smtp10.uk.ibm.com [195.75.94.106]) by mx0a-001b2d01.pphosted.com with ESMTP id 2j65fjvbgm-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 25 May 2018 00:50:26 -0400 Received: from localhost by e06smtp10.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 25 May 2018 05:50:24 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) by e06smtp10.uk.ibm.com (192.168.101.140) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 25 May 2018 05:50:20 +0100 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w4P4oKoj49152054; Fri, 25 May 2018 04:50:20 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A0D61AE056; Fri, 25 May 2018 05:39:31 +0100 (BST) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 20024AE045; Fri, 25 May 2018 05:39:29 +0100 (BST) Received: from [9.202.15.56] (unknown [9.202.15.56]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTP; Fri, 25 May 2018 05:39:28 +0100 (BST) Subject: Re: [PATCH 2/2] mm: do not warn on offline nodes unless the specific node is explicitly requested To: Michal Hocko , Anshuman Khandual References: <20180523125555.30039-1-mhocko@kernel.org> <20180523125555.30039-3-mhocko@kernel.org> <11e26a4e-552e-b1dc-316e-ce3e92973556@linux.vnet.ibm.com> <20180523140601.GQ20441@dhcp22.suse.cz> <094afec3-5682-f99d-81bb-230319c78d5d@linux.vnet.ibm.com> <20180524080011.GV20441@dhcp22.suse.cz> Cc: Andrew Morton , Oscar Salvador , Vlastimil Babka , Pavel Tatashin , Reza Arbab , Igor Mammedov , Vitaly Kuznetsov , LKML , linux-mm@kvack.org From: Anshuman Khandual Date: Fri, 25 May 2018 10:20:16 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <20180524080011.GV20441@dhcp22.suse.cz> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 x-cbid: 18052504-0040-0000-0000-0000043DA539 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18052504-0041-0000-0000-00002642E538 Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-05-25_01:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1805250057 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/24/2018 01:30 PM, Michal Hocko wrote: > On Thu 24-05-18 08:52:14, Anshuman Khandual wrote: >> On 05/23/2018 07:36 PM, Michal Hocko wrote: >>> On Wed 23-05-18 19:15:51, Anshuman Khandual wrote: >>>> On 05/23/2018 06:25 PM, Michal Hocko wrote: >>>>> when adding memory to a node that is currently offline. >>>>> >>>>> The VM_WARN_ON is just too loud without a good reason. In this >>>>> particular case we are doing >>>>> alloc_pages_node(node, GFP_KERNEL|__GFP_RETRY_MAYFAIL|__GFP_NOWARN, order) >>>>> >>>>> so we do not insist on allocating from the given node (it is more a >>>>> hint) so we can fall back to any other populated node and moreover we >>>>> explicitly ask to not warn for the allocation failure. >>>>> >>>>> Soften the warning only to cases when somebody asks for the given node >>>>> explicitly by __GFP_THISNODE. >>>> >>>> node hint passed here eventually goes into __alloc_pages_nodemask() >>>> function which then picks up the applicable zonelist irrespective of >>>> the GFP flag __GFP_THISNODE. >>> >>> __GFP_THISNODE should enforce the given node without any fallbacks >>> unless something has changed recently. >> >> Right. I was just saying requiring given preferred node to be online >> whose zonelist (hence allocation zone fallback order) is getting picked >> up during allocation and warning when that is not online still makes >> sense. > > Why? We have a fallback and that is expected to be used. How does > offline differ from depleted node from the semantical point of view? Hmm, right. I agree. Offlined and depleted nodes are same from memory allocation semantics point of view. It will proceed picking up next available zones on the zonelist in the fallback order exactly in the same fashion either way. > >> We should only hide the warning if the allocation request has >> __GFP_NOWARN. >> >>> >>>> Though we can go into zones of other >>>> nodes if the present node (whose zonelist got picked up) does not >>>> have any memory in it's zones. So warning here might not be without >>>> any reason. >>> >>> I am not sure I follow. Are you suggesting a different VM_WARN_ON? >> >> I am just suggesting this instead. >> >> diff --git a/include/linux/gfp.h b/include/linux/gfp.h >> index 036846fc00a6..7f860ea29ec6 100644 >> --- a/include/linux/gfp.h >> +++ b/include/linux/gfp.h >> @@ -464,7 +464,7 @@ static inline struct page * >> __alloc_pages_node(int nid, gfp_t gfp_mask, unsigned int order) >> { >> VM_BUG_ON(nid < 0 || nid >= MAX_NUMNODES); >> - VM_WARN_ON(!node_online(nid)); >> + VM_WARN_ON(!(gfp_mask & __GFP_NOWARN) && !node_online(nid)); >> >> return __alloc_pages(gfp_mask, order, nid); >> } > > I have considered that but I fail to see why should we warn about > regular GFP_KERNEL allocations as mentioned above. Just consider an > allocation for the preffered node. Do you want to warn just because that > node went offline? As you have mentioned before, the semantics is similar when the node is offlined compared to when its depleted. Right. I tend to agree with your approach of not warning in such situations.