Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2935250ybl; Thu, 29 Aug 2019 15:21:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqwQDx9/eVopJHiI2bzi08HeHo3seHwxDjibv+JlNj+5f5JtmiwbLJDLX+I7AMh3pj8CfOw5 X-Received: by 2002:a17:902:2f03:: with SMTP id s3mr334878plb.333.1567117281335; Thu, 29 Aug 2019 15:21:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567117281; cv=none; d=google.com; s=arc-20160816; b=DuEy7XMnmzZuFtKdhKHIkUsE5/aGgz1k1zsYeytUyx2PZDCei+Cf7BL84tDWhD4q5f exP0k4GUt42Dv+oKovpYlitG7eXKSbBkVtV14Z6YupHeooO4PR2Hdk216hlZYpqnnhkd rFseeUqWOuWv2+KnYpBcBcTbc5lNbyrxZRzD8yZuBQWZI3SFEZIOcRh+sjOhoMY/872X 9JXJZaVgrAmhZCc9zxdHLnVZWNqQt6SnNg3QTDGMgO1CzwCIbnwmfemF7Xpu8v8hAURd 4NWamE3Qf1REBozNZppoO4+MTxtR+mcTBQzqBZXiHIGSK62Ws7jewrXYcpx/7CSQOSYT /0Rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date:dkim-signature; bh=GVOqYmM2Y9fBLs59pkcO9sFEhdR0n+gm/H+kyKc15XE=; b=E1kwsQ4ACIMOgfo3BxjWRhXir3qyXQnpq0bLvGi4KTuUpGpKsPM8nbIPU/OHAGyZzo AeQ2q7iO9CfjlOL+sDdHCYww3dUA08BE+3gBbqFVWNZi5bZuCTUpbg8l7vFqU9xZMHzT NONbpvIXJAb2MIeIq5SwCODPZMsCI8hFtsWrLM2zh5Sljqymdfyw7O7vfD+3XHSym9w7 RgwiDpINvOIy7qW9WBCR0hdpLphNtUHnpceuwKWEb0hd+AeIB8jGimRiL/K0l1E4zZPx ULL/Hgpd+bMiXaYZHHUCO8dyNBZXgeUS0VqjoiRPc95imO8ilDED1GvtQTO19h4tNpM1 jNSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=wHVCvNK3; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x18si3085688plm.396.2019.08.29.15.21.05; Thu, 29 Aug 2019 15:21:21 -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=@google.com header.s=20161025 header.b=wHVCvNK3; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728143AbfH2WUS (ORCPT + 99 others); Thu, 29 Aug 2019 18:20:18 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:42636 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727973AbfH2WUS (ORCPT ); Thu, 29 Aug 2019 18:20:18 -0400 Received: by mail-pg1-f195.google.com with SMTP id p3so2330256pgb.9 for ; Thu, 29 Aug 2019 15:20:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=GVOqYmM2Y9fBLs59pkcO9sFEhdR0n+gm/H+kyKc15XE=; b=wHVCvNK39KHNNY4HF3wY3NkJLZfOQdCUJiXGoeP3T/UDxPop1ECLnAFxcV0rEx8o+V JII5v6i7ZKHZbB05yBaZWYkEkvtpXIxCOQ9/Ngr78cCBrGPq2H9YRnlZLgd1JgeB7TzQ Mg/ABGmKuMRLYkfv48QYdY2hw5qmbwl+S0vr1J9xwOT8koG0uEqPixqdHtw13NjbG5BJ DaUulH0se+pqYeKc75oa4Nn2nZUfEypOub+1sR5ZzZAf8fLFoJFDE8gDt8ujD6W9+ucV 6UbeWaISsva/vvH4dDm5VeQ30cP4V3iK4XVKpqdzdjq89ujQQl02u4rinAEi2ei8MXW5 e5iQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=GVOqYmM2Y9fBLs59pkcO9sFEhdR0n+gm/H+kyKc15XE=; b=hfNUEcajRKWe4Kq5d4yk3+MzkZLinqD2JiAnroncAvIox1XMBvUbMLLRq8hUVqCDvu LGqeqP3ZqauIiuDQN9eckRGZnCBUqjQZdoKYZB34hozVD5XRYi3wGQOSoaA525VDNV9x gUvZQPEhkpu3ZoFQ6megvewzpq3sJGs0G858n86BP2J4Kevi4KQGspO46Wdg/TslQ5KQ 9i7jVQ7c/aRhla9sATx8Y5fpNvF1QxbdsUUnzLMRTzOUcGXF51JWFNifFwkgbphxDBCZ eBzhmj292vQwUE5vuiRrAbmmZiQNf9NWG8cop8aD4Pm4QeUhh0c07vUpEeXtcQA9IHMQ rOZQ== X-Gm-Message-State: APjAAAWhJzkV1BRZTs1f22kaw7Q3lWSWdRYAfUONEMVpuwQ8SvtMceuv Hf7k932qIRXfXlr49flWI+L0Ew== X-Received: by 2002:a17:90a:22c9:: with SMTP id s67mr12304024pjc.22.1567117217328; Thu, 29 Aug 2019 15:20:17 -0700 (PDT) Received: from [2620:15c:17:3:3a5:23a7:5e32:4598] ([2620:15c:17:3:3a5:23a7:5e32:4598]) by smtp.gmail.com with ESMTPSA id e189sm3157869pgc.15.2019.08.29.15.20.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Aug 2019 15:20:16 -0700 (PDT) Date: Thu, 29 Aug 2019 15:20:16 -0700 (PDT) From: David Rientjes X-X-Sender: rientjes@chino.kir.corp.google.com To: Michal Hocko cc: Andrew Morton , David Hildenbrand , linux-mm@kvack.org, LKML , Michal Hocko Subject: Re: [PATCH] mm, oom: consider present pages for the node size In-Reply-To: <20190829163443.899-1-mhocko@kernel.org> Message-ID: References: <20190829163443.899-1-mhocko@kernel.org> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 29 Aug 2019, Michal Hocko wrote: > From: Michal Hocko > > constrained_alloc calculates the size of the oom domain by using > node_spanned_pages which is incorrect because this is the full range of > the physical memory range that the numa node occupies rather than the > memory that backs that range which is represented by node_present_pages. > > Sparsely populated nodes (e.g. after memory hot remove or simply sparse > due to memory layout) can have really a large difference between the > two. This shouldn't really cause any real user observable problems > because the oom calculates a ratio against totalpages and used memory > cannot exceed present pages but it is confusing and wrong from code > point of view. > > Noticed-by: David Hildenbrand > Signed-off-by: Michal Hocko Acked-by: David Rientjes