From patchwork Sun Dec 7 18:55:33 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Hocko X-Patchwork-Id: 5452491 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 1C46BBEEA8 for ; Sun, 7 Dec 2014 18:55:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F14C820172 for ; Sun, 7 Dec 2014 18:55:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 03D2D20154 for ; Sun, 7 Dec 2014 18:55:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753052AbaLGSzi (ORCPT ); Sun, 7 Dec 2014 13:55:38 -0500 Received: from mail-wg0-f45.google.com ([74.125.82.45]:37464 "EHLO mail-wg0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753005AbaLGSzh (ORCPT ); Sun, 7 Dec 2014 13:55:37 -0500 Received: by mail-wg0-f45.google.com with SMTP id b13so4650578wgh.32 for ; Sun, 07 Dec 2014 10:55:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=VPEIm/ujPekszlv4c5uNqHvvHUdy5L3sOwLDvkpX0jc=; b=ONtoMjHfmFKfwUvH6oeHjUmzd87h9rPxlzJi9lpU7dzUDkRV6lbxTNLmrsnejlfJFZ bU5x9Tg8W+Fj6D44NxsdVqgXCZiUnPc4nKdlnvrXmynqujC0PjqJPBYAuTHZxSoyn+S9 Fnohd8ZUqXb9mHZiYEqkiZxF7KfZ2NpolncqvkAXPte56UEiDH6ON2OXlkc7CRa1A793 J2OMNs5wXzNDiLtNhtMkJvj8ulGa8MPBxbT7OzUK54IKHcQdWzy/7BtALdf5CgixLXoS ih0xc9hwoZHKde9y+TP4pYdxLBTMQ2ltIPQ62yQK7/iPO9didtmDlbsMvscODezq0BHn ZKaw== X-Received: by 10.180.198.145 with SMTP id jc17mr19018329wic.67.1417978535960; Sun, 07 Dec 2014 10:55:35 -0800 (PST) Received: from localhost (ip-78-45-94-81.net.upcbroadband.cz. [78.45.94.81]) by mx.google.com with ESMTPSA id cp4sm53615089wjb.16.2014.12.07.10.55.34 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 07 Dec 2014 10:55:35 -0800 (PST) Date: Sun, 7 Dec 2014 19:55:33 +0100 From: Michal Hocko To: Tejun Heo Cc: linux-mm@kvack.org, Andrew Morton , "\\\"Rafael J. Wysocki\\\"" , David Rientjes , Johannes Weiner , Oleg Nesterov , Cong Wang , LKML , linux-pm@vger.kernel.org Subject: Re: [PATCH -v2 2/5] OOM: thaw the OOM victim if it is frozen Message-ID: <20141207185533.GA29065@dhcp22.suse.cz> References: <20141110163055.GC18373@dhcp22.suse.cz> <1417797707-31699-1-git-send-email-mhocko@suse.cz> <1417797707-31699-3-git-send-email-mhocko@suse.cz> <20141206130657.GC18711@htj.dyndns.org> <20141207102430.GF15892@dhcp22.suse.cz> <20141207104539.GK15892@dhcp22.suse.cz> <20141207135940.GB19034@htj.dyndns.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20141207135940.GB19034@htj.dyndns.org> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Sun 07-12-14 08:59:40, Tejun Heo wrote: > On Sun, Dec 07, 2014 at 11:45:39AM +0100, Michal Hocko wrote: > .... > > void mark_tsk_oom_victim(struct task_struct *tsk) > > { > > set_tsk_thread_flag(tsk, TIF_MEMDIE); > > + __thaw_task(tsk); > > Yeah, this is a lot better. Maybe we can add a comment at least > pointing readers to where to look at to understand what's going on? > This stems from the fact that OOM killer which essentially is a memory > reclaim operation overrides freezing. It'd be nice if that is > documented somehow. Better? diff --git a/mm/oom_kill.c b/mm/oom_kill.c index 19a08f3f00ba..fca456fe855a 100644 --- a/mm/oom_kill.c +++ b/mm/oom_kill.c @@ -426,6 +426,13 @@ void note_oom_kill(void) void mark_tsk_oom_victim(struct task_struct *tsk) { set_tsk_thread_flag(tsk, TIF_MEMDIE); + + /* + * Make sure that the task is woken up from uninterruptible sleep + * if it is frozen because OOM killer wouldn't be able to free + * any memory and livelock. freezing_slow_path will tell the freezer + * that TIF_MEMDIE tasks should be ignored. + */ __thaw_task(tsk); }