From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michal Hocko Subject: Re: [RFC PATCH] mm, oom: distinguish blockable mode for mmu notifiers Date: Mon, 2 Jul 2018 14:56:29 +0200 Message-ID: <20180702125629.GR19043@dhcp22.suse.cz> References: <20180622150242.16558-1-mhocko@kernel.org> <20180627074421.GF32348@dhcp22.suse.cz> <71f4184c-21ea-5af1-eeb6-bf7787614e2d@amd.com> <20180702115423.GK19043@dhcp22.suse.cz> <725cb1ad-01b0-42b5-56f0-c08c29804cb4@amd.com> <20180702122003.GN19043@dhcp22.suse.cz> <02d1d52c-f534-f899-a18c-a3169123ac7c@amd.com> <20180702123521.GO19043@dhcp22.suse.cz> <91ad1106-6bd4-7d2c-4d40-7c5be945ba36@amd.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Return-path: Content-Disposition: inline In-Reply-To: <91ad1106-6bd4-7d2c-4d40-7c5be945ba36-5C7GfCeVMHo@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org Sender: "amd-gfx" To: Christian =?iso-8859-1?Q?K=F6nig?= Cc: kvm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Radim =?utf-8?B?S3LEjW3DocWZ?= , David Airlie , Joonas Lahtinen , Sudeep Dutt , dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org, linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org, Andrea Arcangeli , "David (ChunMing) Zhou" , Dimitri Sivanich , linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org, Jason Gunthorpe , Doug Ledford , David Rientjes , xen-devel-GuqFBffKawtpuQazS67q72D2FQJk+8+b@public.gmane.org, intel-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org, Jani Nikula , =?iso-8859-1?B?Suly9G1l?= Glisse , Rodrigo Vivi , Boris Ostrovsky , Juergen Gross , Mike Marciniszyn , Dennis List-Id: linux-rdma@vger.kernel.org T24gTW9uIDAyLTA3LTE4IDE0OjM5OjUwLCBDaHJpc3RpYW4gS8O2bmlnIHdyb3RlOgpbLi4uXQo+ IE5vdCB3YW50aW5nIHRvIGJsb2NrIHNvbWV0aGluZyBhcyBpbXBvcnRhbnQgYXMgdGhpcywgc28g ZmVlbCBmcmVlIHRvIGFkZCBhbgo+IEFja2VkLWJ5OiBDaHJpc3RpYW4gS8O2bmlnIDxjaHJpc3Rp YW4ua29lbmlnQGFtZC5jb20+IHRvIHRoZSBwYXRjaC4KClRoYW5rcyBhIGxvdCEKCj4gTGV0J3Mg cmF0aGVyIGZhY2UgdGhlIG5leHQgdG9waWM6IEFueSBpZGVhIGhvdyB0byBydW50aW1lIHRlc3Qg dGhpcz8KClRoaXMgaXMgYSBnb29kIHF1ZXN0aW9uIGluZGVlZC4gT25lIHdheSB0byBkbyB0aGF0 IHdvdWxkIGJlIHRyaWdnZXJpbmcKdGhlIE9PTSBraWxsZXIgZnJvbSB0aGUgY29udGV4dCB3aGlj aCB1c2VzIGVhY2ggb2YgdGhlc2UgbW11IG5vdGlmaWVycwoob25lIGF0IHRoZSB0aW1lKSBhbmQg c2VlIGhvdyB0aGF0IHdvcmtzLiBZb3Ugd291bGQgc2VlIHRoZSBub3RlIGluIHRoZQpsb2cgd2hl bmV2ZXIgdGhlIG5vdGlmaWVyIHdvdWxkIGJsb2NrLiBUaGUgcHJpbWFyeSB0aGluZyB0byB0ZXN0 IGlzIGhvdwpvZnRlbiB0aGUgb29tIHJlYXBlciByZWFsbHkgaGFkIHRvIGJhY2sgb2ZmIGNvbXBs ZXRlbHkuCgo+IEkgbWVhbiBJIGNhbiByYXRoZXIgZWFzaWx5IHByb3ZpZGUgYSB0ZXN0IHdoaWNo IGNyYXNoZXMgYW4gQU1EIEdQVSwgd2hpY2ggaW4KPiB0dXJuIHRoZW4gd291bGQgbWVhbiB0aGF0 IHRoZSBNTVUgbm90aWZpZXIgd291bGQgYmxvY2sgZm9yZXZlciB3aXRob3V0IHRoaXMKPiBwYXRj aC4KCldlbGwsIHlvdSBkbyBub3QgcmVhbGx5IGhhdmUgdG8gZ28gdGhhdCBmYXIuIEl0IHNob3Vs ZCBiZSBzdWZmaWNpZW50IHRvCmRvIHRoZSBhYm92ZS4gVGhlIGN1cnJlbnQgY29kZSB3b3VsZCBz aW1wbHkgYmFjayBvZiB3aXRob3V0IHJlbGVhc2luZwphbnkgbWVtb3J5LiBUaGUgcGF0Y2ggc2hv dWxkIGhlbHAgdG8gcmVjbGFpbSBzb21lIG1lbW9yeS4KIAo+IEJ1dCBkbyB5b3Uga25vdyBhIHdh eSB0byBsZXQgdGhlIE9PTSBraWxsZXIga2lsbCBhIHNwZWNpZmljIHByb2Nlc3M/CgpZZXMsIHlv dSBjYW4gc2V0IGl0cyBvb21fc2NvcmVfYWRqIHRvIDEwMDAgd2hpY2ggbWVhbnMgYWx3YXlzIHNl bGVjdAp0aGF0IHRhc2suCi0tIApNaWNoYWwgSG9ja28KU1VTRSBMYWJzCl9fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCmFtZC1nZnggbWFpbGluZyBsaXN0CmFt ZC1nZnhAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlzdHMuZnJlZWRlc2t0b3Aub3Jn L21haWxtYW4vbGlzdGluZm8vYW1kLWdmeAo= 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.5 required=3.0 tests=MAILING_LIST_MULTI,SPF_PASS, USER_AGENT_MUTT autolearn=ham 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 64830C3279B for ; Mon, 2 Jul 2018 12:56:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 28FCC25C32 for ; Mon, 2 Jul 2018 12:56:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 28FCC25C32 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752552AbeGBM4i (ORCPT ); Mon, 2 Jul 2018 08:56:38 -0400 Received: from mx2.suse.de ([195.135.220.15]:37092 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752403AbeGBM4e (ORCPT ); Mon, 2 Jul 2018 08:56:34 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 214F1AD1B; Mon, 2 Jul 2018 12:56:32 +0000 (UTC) Date: Mon, 2 Jul 2018 14:56:29 +0200 From: Michal Hocko To: Christian =?iso-8859-1?Q?K=F6nig?= Cc: LKML , "David (ChunMing) Zhou" , Paolo Bonzini , Radim =?utf-8?B?S3LEjW3DocWZ?= , Alex Deucher , David Airlie , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Doug Ledford , Jason Gunthorpe , Mike Marciniszyn , Dennis Dalessandro , Sudeep Dutt , Ashutosh Dixit , Dimitri Sivanich , Boris Ostrovsky , Juergen Gross , =?iso-8859-1?B?Suly9G1l?= Glisse , Andrea Arcangeli , kvm@vger.kernel.org, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux-rdma@vger.kernel.org, xen-devel@lists.xenproject.org, linux-mm@kvack.org, David Rientjes , Felix Kuehling Subject: Re: [RFC PATCH] mm, oom: distinguish blockable mode for mmu notifiers Message-ID: <20180702125629.GR19043@dhcp22.suse.cz> References: <20180622150242.16558-1-mhocko@kernel.org> <20180627074421.GF32348@dhcp22.suse.cz> <71f4184c-21ea-5af1-eeb6-bf7787614e2d@amd.com> <20180702115423.GK19043@dhcp22.suse.cz> <725cb1ad-01b0-42b5-56f0-c08c29804cb4@amd.com> <20180702122003.GN19043@dhcp22.suse.cz> <02d1d52c-f534-f899-a18c-a3169123ac7c@amd.com> <20180702123521.GO19043@dhcp22.suse.cz> <91ad1106-6bd4-7d2c-4d40-7c5be945ba36@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <91ad1106-6bd4-7d2c-4d40-7c5be945ba36@amd.com> User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 02-07-18 14:39:50, Christian König wrote: [...] > Not wanting to block something as important as this, so feel free to add an > Acked-by: Christian König to the patch. Thanks a lot! > Let's rather face the next topic: Any idea how to runtime test this? This is a good question indeed. One way to do that would be triggering the OOM killer from the context which uses each of these mmu notifiers (one at the time) and see how that works. You would see the note in the log whenever the notifier would block. The primary thing to test is how often the oom reaper really had to back off completely. > I mean I can rather easily provide a test which crashes an AMD GPU, which in > turn then would mean that the MMU notifier would block forever without this > patch. Well, you do not really have to go that far. It should be sufficient to do the above. The current code would simply back of without releasing any memory. The patch should help to reclaim some memory. > But do you know a way to let the OOM killer kill a specific process? Yes, you can set its oom_score_adj to 1000 which means always select that task. -- Michal Hocko SUSE Labs From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) by kanga.kvack.org (Postfix) with ESMTP id 0BB126B0010 for ; Mon, 2 Jul 2018 08:56:34 -0400 (EDT) Received: by mail-ed1-f69.google.com with SMTP id c19-v6so1302582edt.4 for ; Mon, 02 Jul 2018 05:56:33 -0700 (PDT) Received: from mx1.suse.de (mx2.suse.de. [195.135.220.15]) by mx.google.com with ESMTPS id v12-v6si896147edf.375.2018.07.02.05.56.32 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Jul 2018 05:56:32 -0700 (PDT) Date: Mon, 2 Jul 2018 14:56:29 +0200 From: Michal Hocko Subject: Re: [RFC PATCH] mm, oom: distinguish blockable mode for mmu notifiers Message-ID: <20180702125629.GR19043@dhcp22.suse.cz> References: <20180622150242.16558-1-mhocko@kernel.org> <20180627074421.GF32348@dhcp22.suse.cz> <71f4184c-21ea-5af1-eeb6-bf7787614e2d@amd.com> <20180702115423.GK19043@dhcp22.suse.cz> <725cb1ad-01b0-42b5-56f0-c08c29804cb4@amd.com> <20180702122003.GN19043@dhcp22.suse.cz> <02d1d52c-f534-f899-a18c-a3169123ac7c@amd.com> <20180702123521.GO19043@dhcp22.suse.cz> <91ad1106-6bd4-7d2c-4d40-7c5be945ba36@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <91ad1106-6bd4-7d2c-4d40-7c5be945ba36@amd.com> Sender: owner-linux-mm@kvack.org List-ID: To: Christian =?iso-8859-1?Q?K=F6nig?= Cc: LKML , "David (ChunMing) Zhou" , Paolo Bonzini , Radim =?utf-8?B?S3LEjW3DocWZ?= , Alex Deucher , David Airlie , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Doug Ledford , Jason Gunthorpe , Mike Marciniszyn , Dennis Dalessandro , Sudeep Dutt , Ashutosh Dixit , Dimitri Sivanich , Boris Ostrovsky , Juergen Gross , =?iso-8859-1?B?Suly9G1l?= Glisse , Andrea Arcangeli , kvm@vger.kernel.org, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux-rdma@vger.kernel.org, xen-devel@lists.xenproject.org, linux-mm@kvack.org, David Rientjes , Felix Kuehling On Mon 02-07-18 14:39:50, Christian Konig wrote: [...] > Not wanting to block something as important as this, so feel free to add an > Acked-by: Christian Konig to the patch. Thanks a lot! > Let's rather face the next topic: Any idea how to runtime test this? This is a good question indeed. One way to do that would be triggering the OOM killer from the context which uses each of these mmu notifiers (one at the time) and see how that works. You would see the note in the log whenever the notifier would block. The primary thing to test is how often the oom reaper really had to back off completely. > I mean I can rather easily provide a test which crashes an AMD GPU, which in > turn then would mean that the MMU notifier would block forever without this > patch. Well, you do not really have to go that far. It should be sufficient to do the above. The current code would simply back of without releasing any memory. The patch should help to reclaim some memory. > But do you know a way to let the OOM killer kill a specific process? Yes, you can set its oom_score_adj to 1000 which means always select that task. -- Michal Hocko SUSE Labs