From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 824DBC4321A for ; Fri, 28 Jun 2019 07:10:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5B39A215EA for ; Fri, 28 Jun 2019 07:10:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561705858; bh=bXCSp0dCRSkuKXohh2hUp0YiM3wnBP5ow+pJwgKNQhQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=CaWfUiDXVC1wGxC8c1MzI2r69hEEa6dm50Qb6YpzAvijx4Q2Q4Wn1+LphGpCisvVn BOTs4Nyxd7rmkFNGEmV6dpbUj4pfWe71RoDH2H1/mFJiQQnglUi58lAyMIMXRRMl2H R7KHe6Nl82f04zWowbVXWHiaHCKga18AYKtg/j9c= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727228AbfF1HKy (ORCPT ); Fri, 28 Jun 2019 03:10:54 -0400 Received: from mx2.suse.de ([195.135.220.15]:57106 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726574AbfF1HKy (ORCPT ); Fri, 28 Jun 2019 03:10:54 -0400 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 A3B15B16F; Fri, 28 Jun 2019 07:10:51 +0000 (UTC) Date: Fri, 28 Jun 2019 09:10:49 +0200 From: Michal Hocko To: Waiman Long 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 Subject: Re: [PATCH 1/2] mm, memcontrol: Add memcg_iterate_all() Message-ID: <20190628071049.GA2751@dhcp22.suse.cz> References: <20190624174219.25513-1-longman@redhat.com> <20190624174219.25513-2-longman@redhat.com> <20190627150746.GD5303@dhcp22.suse.cz> <2213070d-34c3-4f40-d780-ac371a9cbbbe@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2213070d-34c3-4f40-d780-ac371a9cbbbe@redhat.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Thu 27-06-19 17:03:06, Waiman Long wrote: > 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. That would be preferred. Thanks! -- Michal Hocko SUSE Labs