From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755398AbbE2GzM (ORCPT ); Fri, 29 May 2015 02:55:12 -0400 Received: from cantor2.suse.de ([195.135.220.15]:33781 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752111AbbE2GzG (ORCPT ); Fri, 29 May 2015 02:55:06 -0400 Date: Fri, 29 May 2015 08:55:04 +0200 From: Michal Hocko To: Andrew Morton Cc: Vladimir Davydov , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Johannes Weiner Subject: Re: [PATCH] memcg: do not call reclaim if !__GFP_WAIT Message-ID: <20150529065504.GA22728@dhcp22.suse.cz> References: <1432833966-25538-1-git-send-email-vdavydov@parallels.com> <20150528125934.198f57db4c5daf19dd15b184@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150528125934.198f57db4c5daf19dd15b184@linux-foundation.org> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 28-05-15 12:59:34, Andrew Morton wrote: > On Thu, 28 May 2015 20:26:06 +0300 Vladimir Davydov wrote: > > > When trimming memcg consumption excess (see memory.high), we call > > try_to_free_mem_cgroup_pages without checking if we are allowed to sleep > > in the current context, which can result in a deadlock. Fix this. > > Why does it deadlock? try_to_free_mem_cgroup_pages() is passed the > gfp_mask and should honour its __GFP_WAIT setting? The only instance of __GFP_WAIT check in vmscan code is in zone_reclaim. Page allocations and memcg reclaim avoids calling reclaim if __GFP_WAIT is not set. Maybe we can move the check to do_try_to_free_pages? -- Michal Hocko SUSE Labs