From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on archive.lwn.net X-Spam-Level: X-Spam-Status: No, score=-5.7 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by archive.lwn.net (Postfix) with ESMTP id 655777D2F0 for ; Thu, 27 Jun 2019 21:03:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726508AbfF0VDS (ORCPT ); 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-doc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-doc@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