From patchwork Thu Jul 14 17:36:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Hocko X-Patchwork-Id: 9230371 X-Patchwork-Delegate: snitzer@redhat.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6519C607D0 for ; Thu, 14 Jul 2016 17:40:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 58053281B7 for ; Thu, 14 Jul 2016 17:40:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4C6EF28305; Thu, 14 Jul 2016 17:40:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from mx5-phx2.redhat.com (mx5-phx2.redhat.com [209.132.183.37]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id BB318281B7 for ; Thu, 14 Jul 2016 17:40:53 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx5-phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u6EHb6gX052990; Thu, 14 Jul 2016 13:37:06 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id u6EHb5lq000673 for ; Thu, 14 Jul 2016 13:37:05 -0400 Received: from mx1.redhat.com (ext-mx05.extmail.prod.ext.phx2.redhat.com [10.5.110.29]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u6EHb5mh032741 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 14 Jul 2016 13:37:05 -0400 Received: from mail-wm0-f41.google.com (mail-wm0-f41.google.com [74.125.82.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 93CD3476; Thu, 14 Jul 2016 17:37:02 +0000 (UTC) Received: by mail-wm0-f41.google.com with SMTP id f126so74508081wma.1; Thu, 14 Jul 2016 10:37:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=Bmijz25YE9k7JkK0P4Vl4yLDff2kMzS6ig5I8PPa3cQ=; b=FaejnD2ykNOyivcXY71naTFE/D8jUFB22Busol7L81cmTevT0WMEwzTup3xH5Ati2Z NYKB8lL9undneMLZ3cg+MMSggQKgiVfXwht7eCqX2YkkKkvDH3owwdtwPm/47tIPjq/6 8XA6SMgMiF+3tEJ9qqIfBUXMNPgruMSH8+imZFjmMAFrm+3Hwgq6M1/BhuUxGDpezG9M GNmsh9Pr+Kqasy0zR9+BTwJ1/VX6pU7Gsxo+sWS2QqExquLQWyPgm4SoaXIWt90PuUUy 23mrJklc0rzc+FmXjtNo7Fd1CCICae+xA+Avif1RTVEozsJ+CW32W1FaQgwg9LgEni9Y QohQ== X-Gm-Message-State: ALyK8tKjnzmGfbew/hsb6DXDg3H6v6PEs1TFh3KgBReg02+K2fPdcqfKrOBQRFAMCQMaGw== X-Received: by 10.28.164.132 with SMTP id n126mr33930326wme.36.1468517821181; Thu, 14 Jul 2016 10:37:01 -0700 (PDT) Received: from localhost (ip-86-49-65-8.net.upcbroadband.cz. [86.49.65.8]) by smtp.gmail.com with ESMTPSA id z5sm3296786wme.5.2016.07.14.10.37.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Jul 2016 10:37:00 -0700 (PDT) Date: Thu, 14 Jul 2016 19:36:59 +0200 From: Michal Hocko To: Ondrej Kozina Message-ID: <20160714173659.GA29355@dhcp22.suse.cz> References: <9be09452-de7f-d8be-fd5d-4a80d1cd1ba3@redhat.com> <20160712064905.GA14586@dhcp22.suse.cz> <20160713111006.GF28723@dhcp22.suse.cz> <20160714125129.GA12289@dhcp22.suse.cz> <740b17f0-e1bb-b021-e9e1-ad6dcf5f033a@redhat.com> <20160714153120.GD12289@dhcp22.suse.cz> <9ca3459a-8226-b870-163e-58e2bb10df74@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <9ca3459a-8226-b870-163e-58e2bb10df74@redhat.com> User-Agent: Mutt/1.6.0 (2016-04-01) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Thu, 14 Jul 2016 17:37:02 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Thu, 14 Jul 2016 17:37:02 +0000 (UTC) for IP:'74.125.82.41' DOMAIN:'mail-wm0-f41.google.com' HELO:'mail-wm0-f41.google.com' FROM:'mstsxfx@gmail.com' RCPT:'' X-RedHat-Spam-Score: -0.318 (BAYES_50, DCC_REPUT_00_12, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_PASS) 74.125.82.41 mail-wm0-f41.google.com 74.125.82.41 mail-wm0-f41.google.com X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Scanned-By: MIMEDefang 2.78 on 10.5.110.29 X-loop: dm-devel@redhat.com Cc: Jerome Marchand , linux-kernel@vger.kernel.org, linux-mm@kvack.org, dm-devel@redhat.com, Mikulas Patocka , Stanislav Kozina Subject: Re: [dm-devel] System freezes after OOM X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Virus-Scanned: ClamAV using ClamSMTP On Thu 14-07-16 19:07:52, Ondrej Kozina wrote: > On 07/14/2016 05:31 PM, Michal Hocko wrote: > > On Thu 14-07-16 16:08:28, Ondrej Kozina wrote: > > [...] > > > As Mikulas pointed out, this doesn't work. The system froze as well with the > > > patch above. Will try to tweak the patch with Mikulas's suggestion... > > > > Thank you for testing! Do you happen to have traces of the frozen > > processes? Does the flusher still gets throttled because the bias it > > gets is not sufficient. Or does it get throttled at a different place? > > > > Sure. Here it is (including sysrq+t and sysrq+w output): https://okozina.fedorapeople.org/bugs/swap_on_dmcrypt/4.7.0-rc7+/1/4.7.0-rc7+.log Thanks a lot! This is helpful. [ 162.716376] active_anon:107874 inactive_anon:108176 isolated_anon:64 [ 162.716376] active_file:1086 inactive_file:1103 isolated_file:0 [ 162.716376] unevictable:0 dirty:0 writeback:69824 unstable:0 [ 162.716376] slab_reclaimable:3119 slab_unreclaimable:24124 [ 162.716376] mapped:2165 shmem:57 pagetables:1509 bounce:0 [ 162.716376] free:701 free_pcp:0 free_cma:0 No surprise that PF_LESS_THROTTLE didn't help. It gives some bias but considering how many pages are under writeback it cannot possibly help to prevent from sleeping in throttle_vm_writeout. I suppose adding the following on top of the memalloc patch helps, right? It is an alternative to what you were suggesting in other email but it doesn't affect current_may_throttle paths which I would rather not touch. diff --git a/mm/page-writeback.c b/mm/page-writeback.c index 7fbb2d008078..a37661f1a11b 100644 --- a/mm/page-writeback.c +++ b/mm/page-writeback.c @@ -1971,6 +1971,9 @@ void throttle_vm_writeout(gfp_t gfp_mask) unsigned long background_thresh; unsigned long dirty_thresh; + if (current->flags & PF_LESS_THROTTLE) + return; + for ( ; ; ) { global_dirty_limits(&background_thresh, &dirty_thresh); dirty_thresh = hard_dirty_limit(&global_wb_domain, dirty_thresh);