Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp2527653ybd; Thu, 27 Jun 2019 14:04:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqzfk4CY1c35uXsCld5OK5BN20ZbSLRW/BDXyvLY/chE92vqYOyVzx0frJEYRjw5PDY7j8fF X-Received: by 2002:a63:f953:: with SMTP id q19mr5678006pgk.367.1561669483457; Thu, 27 Jun 2019 14:04:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561669483; cv=none; d=google.com; s=arc-20160816; b=uxfZAL8g/hCZOkBxbbgU0N/VNCvLsfwReznquGoj0nRTV5ZDfAwQshGuf7gfcivcFy H8eNzbCzXo2kF2FlyTRqj98TR8C2FvsLFjKwbzsE7Oaoa7BgAFfjdo1/+J0yFSwlek5m /cATwBHfcvdGe+Z11J/8TVhvmY+Gnp21pJ7gg10bcWT69ft6+9NvGGfWHLWEFmN9x6dv m2gPxPzezSzq2vijGoPEaRAZDyen9H8cTUAPg7G/EveaAwqUrAibii3DKr7oU+2p+YDo gOrffW5av6hNr+QN8t2+w4XCXLh7ebNsZ7VSNgDQOM8AjN2BBeoLbtgJQLFpZZXA9mjm UZKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject; bh=w6Zk2X1UotXBBdbiqYU/9wWxwQErmet13FPhuMOM6+c=; b=LvSUaC1NKWNapvpH0+PoNwYbwJrCvOETl6dpjfgIdbBxEgC+U2AHNKQwrGPg0YLqLy R6INQMQT382Xi02FJT33H0rP6l0HS26gYUJcFKZTVsIzqeDkp2BZJZBJu00vaz0bBE87 L3OrZYsnPYiHTj332njJMOYRE5UV98QyOpHcW1uWCaneo6EKIGB1yXo+sng9LY4rbY9W Vfd+EIcJKdAESFHNC/9WusunXkqshHqwLMyZMp2LbwjccO/TQ8TFsc/5pIRLD3fdjD0m llSXqAhxMg6KUWHaY5HlOrHoPjfYXuti5QCWf1Yru205ot/ow5lir8h1HV7E1nPcVMJJ i7Dw== 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m16si3332035pls.307.2019.06.27.14.04.27; Thu, 27 Jun 2019 14:04:43 -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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726646AbfF0VDS (ORCPT + 99 others); Thu, 27 Jun 2019 17:03:18 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45960 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726384AbfF0VDR (ORCPT ); Thu, 27 Jun 2019 17:03:17 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CAEA6308620B; Thu, 27 Jun 2019 21:03:10 +0000 (UTC) Received: from llong.remote.csb (dhcp-17-85.bos.redhat.com [10.18.17.85]) by smtp.corp.redhat.com (Postfix) with ESMTP id 24CD61001284; Thu, 27 Jun 2019 21:03:07 +0000 (UTC) Subject: Re: [PATCH 1/2] mm, memcontrol: Add memcg_iterate_all() To: Michal Hocko Cc: Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Alexander Viro , Jonathan Corbet , Luis Chamberlain , Kees Cook , Johannes Weiner , Vladimir Davydov , linux-mm@kvack.org, linux-doc@vger.kernel.org, linux-fsdevel@vger.kernel.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, Roman Gushchin , Shakeel Butt , Andrea Arcangeli References: <20190624174219.25513-1-longman@redhat.com> <20190624174219.25513-2-longman@redhat.com> <20190627150746.GD5303@dhcp22.suse.cz> From: Waiman Long Organization: Red Hat Message-ID: <2213070d-34c3-4f40-d780-ac371a9cbbbe@redhat.com> Date: Thu, 27 Jun 2019 17:03:06 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <20190627150746.GD5303@dhcp22.suse.cz> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Thu, 27 Jun 2019 21:03:17 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/27/19 11:07 AM, Michal Hocko wrote: > On Mon 24-06-19 13:42:18, Waiman Long wrote: >> Add a memcg_iterate_all() function for iterating all the available >> memory cgroups and call the given callback function for each of the >> memory cgruops. > Why is a trivial wrapper any better than open coded usage of the > iterator? Because the iterator is only defined within memcontrol.c. So an alternative may be to put the iterator into a header file that can be used by others. Will take a look at that. Cheers, Longman