From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934575AbdBWBYd (ORCPT ); Wed, 22 Feb 2017 20:24:33 -0500 Received: from mail-pg0-f65.google.com ([74.125.83.65]:33690 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933417AbdBWBYZ (ORCPT ); Wed, 22 Feb 2017 20:24:25 -0500 From: Balbir Singh X-Google-Original-From: Balbir Singh Date: Thu, 23 Feb 2017 12:16:44 +1100 To: Laurent Dufour Cc: Johannes Weiner , Michal Hocko , Vladimir Davydov , cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] mm/cgroup: delay soft limit data allocation Message-ID: <20170223011644.GB8841@balbir.ozlabs.ibm.com> References: <1487779091-31381-1-git-send-email-ldufour@linux.vnet.ibm.com> <1487779091-31381-3-git-send-email-ldufour@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1487779091-31381-3-git-send-email-ldufour@linux.vnet.ibm.com> User-Agent: Mutt/1.7.1 (2016-10-04) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 22, 2017 at 04:58:11PM +0100, Laurent Dufour wrote: > Until a soft limit is set to a cgroup, the soft limit data are useless > so delay this allocation when a limit is set. > > Suggested-by: Michal Hocko > Signed-off-by: Laurent Dufour > --- > @@ -3000,6 +3035,8 @@ static ssize_t mem_cgroup_write(struct kernfs_open_file *of, > } > break; > case RES_SOFT_LIMIT: > + if (!soft_limit_initialized) > + soft_limit_initialize(); What happens if this fails? Do we disable this interface? It's a good idea, but I wonder if we can deal with certain memory cgroups not supporting soft limits due to memory shortage at the time of using them. > memcg->soft_limit = nr_pages; > ret = 0; > break; Balbir Singh.