Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp319802imu; Fri, 16 Nov 2018 03:06:42 -0800 (PST) X-Google-Smtp-Source: AJdET5fmdRA5Pju4Otz+fC2FIVtcWcZknu5ZCkrvsyV/7+FXobUYwNM17uxuCzWG/o/6CQxUwWHG X-Received: by 2002:a17:902:292b:: with SMTP id g40-v6mr9774812plb.279.1542366402650; Fri, 16 Nov 2018 03:06:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542366402; cv=none; d=google.com; s=arc-20160816; b=hjyR8QVMB6ROUs1b+v0r/XpYSWiH/PQ5ovAOC/aXV/F8JXsrqUTeIalUffWsd8xYwE TLmbOn61qUKh990EjCQnta9dp3ghFKTudVin5uaDvALneBrvTdT9EcfTuoPTXN7UeXHv pfmMZmH6k2OvbCyN+e0POaNhMgca/vpiEdbcXk9EDF7jyjI7qQohOXf5DiOwUFMYuYRj wLJ8qIfQHQ/O0C3FEfNtnXQ7OUkHBbr/GqrcbOGunQSrurMB3qruF/0oXO6lMoVWK9RQ 8++aXZYsgSMhxnq2dBDLHWuKW+prN8++JYVaLfD53BY7Fn/w5D1P/AskS/RU3JQ5fcK3 TyRQ== 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:date:cc:to:from:subject:message-id; bh=lhfNrm15Y4UoNsnxqonOxKtnTgLj74J65tbGcmIGzT8=; b=lWX8+YUaCcfM6crbyWRXM7OZvKhpx/rFtr2or9oAZ8TsYnkGEMhN8MgFJOJ1997i01 dpmA9WVmcvT/7P6DNEg2xQSrQeTk3sTGimtqGnInm+0SUD31ZpDxMz6Q7PO9e7RIaizG cBJeE9dn+SuPG4Ii5VQZ2trG39inDcUwpTrQwb3mKNlKE9WYyJtcnTK06n4CQaMu1cZx PY9jyxs0/fSQeNM/8p/cp0BbsvY5SAD6CROfDfFtFGC/Z8IzGDveSnufsPa4cblm2ZRk WcxIlmc03RoSHs5V2q56XXuFGTjQpWv4XCkw9zK6NVAB4ES8Y9H95g5MVVDDmnfzREcK zhVQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c11si30453413pgj.255.2018.11.16.03.06.28; Fri, 16 Nov 2018 03:06:42 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389519AbeKPVRN (ORCPT + 99 others); Fri, 16 Nov 2018 16:17:13 -0500 Received: from mx2.suse.de ([195.135.220.15]:57570 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727630AbeKPVRN (ORCPT ); Fri, 16 Nov 2018 16:17:13 -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 83ABBAF14; Fri, 16 Nov 2018 11:05:20 +0000 (UTC) Message-ID: <1542366304.3020.15.camel@suse.de> Subject: Re: [PATCH] mm: use managed_zone() for more exact check in zone iteration From: osalvador To: Michal Hocko , Andrew Morton Cc: Wei Yang , linux-mm@kvack.org, linux-kernel@vger.kernel.org Date: Fri, 16 Nov 2018 12:05:04 +0100 In-Reply-To: <20181116095720.GE14706@dhcp22.suse.cz> References: <20181114235040.36180-1-richard.weiyang@gmail.com> <20181115133735.bb0313ec9293c415d08be550@linux-foundation.org> <20181116095720.GE14706@dhcp22.suse.cz> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.26.1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2018-11-16 at 10:57 +0100, Michal Hocko wrote: > 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. We can only offline non-reserved pages (so, managed pages). Since present pages holds reserved_pages + managed_pages, decreasing both should be fine unless I am mistaken. Oscar Salvador