Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp254022imu; Fri, 16 Nov 2018 01:58:14 -0800 (PST) X-Google-Smtp-Source: AJdET5dtTTvC8M9R0kTLIA+mRtsef2wXWtD4auVpzTRXuFCOQRhCwtvnY9L+Qv32V0J+kdIhz9iR X-Received: by 2002:a62:1043:: with SMTP id y64-v6mr8022210pfi.79.1542362294371; Fri, 16 Nov 2018 01:58:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542362294; cv=none; d=google.com; s=arc-20160816; b=Y3z6pySRkGkJTqRHWGjdErvzpjHZmV9Z18fm49eBIPdJfoZ++R1i1KuAV4eKvgVpZI /KJcQgxAvLNqoVhn4nhVIw9PGqrs9T7sqyPvzvNYfNPdiKsoUU1/CG0hjn+OHexT6sj5 4ePNYaVSnBc9Ns0pjKBj5OvmWu8ycRWfJJzVKV9AJSQeM3ZAKkBSpzAmWyMpBFX7aEFt IVCmRJ7N/KnkoEySjmb7vSlsmQBJfVcBE/1h4x4uxE8weFaPKZCVWJ0OdnBUHCI28WLS BN1F9/Qrad9tm081F2TlMD/RNJAugbeyHHGglvItzAKOD51t1A77AH7phDx4W1aXThsi AH+w== 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; bh=F0QsTC8YamGFvpd4kO+Hx0Hx59/yqj6EGGxmpSoQMiw=; b=u8To+qICjIwimwhq9fmboMCJle0b42nqIK8cMUOoPTr9o0t5kL8Sbv+aGB24PnPG5O wEI+x7NU3U9TXqrN1C8yRxpFY5skaBr9kpjOYWlbSXAGiHAzsfujqU6kOCXA5dTgIvOU wmKv3kqaxFA9oKDGFGPaU2ZqntuzY2PUmoOKiOC5n2L4rbZexFB2ZZ4DI5UebKMeVt3G CClGUXplh9bErhHaN9WGhSHdLUY4b7fiDP/MhROar0egQlAfrakNmUKKVKab0WfMxk7L QOca6RaR4NxgIu3oGxzcKMDz9abc2wI0HKdnCS2g55+eVQ/0hdtpuzxnqtxsVmIH+SB0 C7/A== 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l132-v6si18539652pfc.263.2018.11.16.01.58.00; Fri, 16 Nov 2018 01:58:14 -0800 (PST) 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389395AbeKPUI5 (ORCPT + 99 others); Fri, 16 Nov 2018 15:08:57 -0500 Received: from mx2.suse.de ([195.135.220.15]:40006 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727442AbeKPUI5 (ORCPT ); Fri, 16 Nov 2018 15:08:57 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 79F1CACA7; Fri, 16 Nov 2018 09:57:20 +0000 (UTC) Date: Fri, 16 Nov 2018 10:57:20 +0100 From: Michal Hocko To: Andrew Morton Cc: Wei Yang , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm: use managed_zone() for more exact check in zone iteration Message-ID: <20181116095720.GE14706@dhcp22.suse.cz> References: <20181114235040.36180-1-richard.weiyang@gmail.com> <20181115133735.bb0313ec9293c415d08be550@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181115133735.bb0313ec9293c415d08be550@linux-foundation.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 15-11-18 13:37:35, Andrew Morton wrote: [...] > Worse, the situations in which managed_zone() != populated_zone() are > rare(?), so it will take a long time for problems to be discovered, I > expect. We would basically have to deplete the whole zone by the bootmem allocator or pull out all pages from the page allocator. E.g. memory hotplug decreases both managed and present counters. I am actually not sure that is 100% correct (put on my TODO list to check). There is no consistency in that regards. That being said, I will review the patch (today hopefully) but fundamentally most users should indeed care about managed pages when iterating zones with memory. There should be a good reason why they might want to look at reserved pages. -- Michal Hocko SUSE Labs