Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2846665imm; Fri, 24 Aug 2018 06:26:21 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaKDdt6PevLo2EbtaOyysVXsDmAcOm0fGibIlzXdJUxQdV75E8Of9g99Qyyhf9Fnc5/Se+0 X-Received: by 2002:a62:4dc1:: with SMTP id a184-v6mr2019394pfb.5.1535117181672; Fri, 24 Aug 2018 06:26:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535117181; cv=none; d=google.com; s=arc-20160816; b=DBlJ4CscAVSImszFCzvXfuXKhbjSTivh/eLuBNXai0pz2uFtxXV2EUBOIx8DU/pXHP S4csiddqGNLbVH+s1Jhn7TkImXndvn8zqXz0qFFPiVqy6NKiE359Ch778nC+kHLLhw/3 az3f5Q8UpX56SY7SY0WQhpBmqnkaPI8FYI7VZMVleN4ODNueBWsypOf6rgMo8ft+BmEQ vFbdu4FfDfLOFoVcCLAqJ0TZti9ZYY1d1Q4XECRVqrOfUpa4IRPACvWZpjr2ADAmD72I JpbJf81lWBsQmF0cHf30QTQ+2i/iD8LrDwGeRmyJAaJJdCto6DqaNPJHnE0Qcm4qn4Ig OoyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=EUnsPW7ed+wIr5OZl2DRMj88FrXbRwH0aNZz1lLmtbg=; b=WxRGbtWDEPq6gemjjOLBE2sOSlsTn8cV8c1azQKzDE+CB/EnD38IYrnJU5GPQudtTt cujG5C4VFUcoQVbsp98udywX7SoevqMzbAV3cdrWpqHrXO2IvlfagX0lpEGVfz3w0UvR U48vaOmF69anrOitseoGm+hFYbE0RgJwgeG9GuxHJ/keLlwoF1JXP3+j51Fb55Yi46lB xJZxuM4rYwZNAlSfdBrQ/hlaEUyy/eRDM5cXxVGAzWXlb4HUnfw9YnZ45+2MWn4WUx60 Z3JkqXyr4nqTxilBugbD7jxACM5gQeLvBc3anbXtpN1EFOKUilxDLzHtT2uSABOO7K5d DMAA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 198-v6si6063235pfz.119.2018.08.24.06.26.06; Fri, 24 Aug 2018 06:26:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727970AbeHXQ70 (ORCPT + 99 others); Fri, 24 Aug 2018 12:59:26 -0400 Received: from mx2.suse.de ([195.135.220.15]:52050 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726883AbeHXQ70 (ORCPT ); Fri, 24 Aug 2018 12:59:26 -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 9096BAE15; Fri, 24 Aug 2018 13:24:43 +0000 (UTC) Date: Fri, 24 Aug 2018 15:24:42 +0200 From: Michal Hocko To: christian.koenig@amd.com Cc: kvm@vger.kernel.org, Radim =?utf-8?B?S3LEjW3DocWZ?= , Tetsuo Handa , Joonas Lahtinen , Sudeep Dutt , dri-devel@lists.freedesktop.org, linux-mm@kvack.org, Andrea Arcangeli , "David (ChunMing) Zhou" , Dimitri Sivanich , Jason Gunthorpe , linux-rdma@vger.kernel.org, amd-gfx@lists.freedesktop.org, David Airlie , Doug Ledford , David Rientjes , xen-devel@lists.xenproject.org, intel-gfx@lists.freedesktop.org, Jani Nikula , Leon Romanovsky , =?iso-8859-1?B?Suly9G1l?= Glisse , Rodrigo Vivi , Boris Ostrovsky , Juergen Gross , Mike Marciniszyn , Dennis Dalessandro , LKML , Ashutosh Dixit , Alex Deucher , Paolo Bonzini , Andrew Morton , Felix Kuehling Subject: Re: [PATCH] mm, oom: distinguish blockable mode for mmu notifiers Message-ID: <20180824132442.GQ29735@dhcp22.suse.cz> References: <20180824113248.GH29735@dhcp22.suse.cz> <20180824115226.GK29735@dhcp22.suse.cz> <20180824120339.GL29735@dhcp22.suse.cz> <20180824123341.GN29735@dhcp22.suse.cz> <20180824130132.GP29735@dhcp22.suse.cz> <23d071d2-82e4-9b78-1000-be44db5f6523@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <23d071d2-82e4-9b78-1000-be44db5f6523@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri 24-08-18 15:10:08, Christian K?nig wrote: > Am 24.08.2018 um 15:01 schrieb Michal Hocko: > > On Fri 24-08-18 14:52:26, Christian K?nig wrote: > > > Am 24.08.2018 um 14:33 schrieb Michal Hocko: > > [...] > > > > Thiking about it some more, I can imagine that a notifier callback which > > > > performs an allocation might trigger a memory reclaim and that in turn > > > > might trigger a notifier to be invoked and recurse. But notifier > > > > shouldn't really allocate memory. They are called from deep MM code > > > > paths and this would be extremely deadlock prone. Maybe Jerome can come > > > > up some more realistic scenario. If not then I would propose to simplify > > > > the locking here. We have lockdep to catch self deadlocks and it is > > > > always better to handle a specific issue rather than having a code > > > > without a clear indication how it can recurse. > > > Well I agree that we should probably fix that, but I have some concerns to > > > remove the existing workaround. > > > > > > See we added that to get rid of a real problem in a customer environment and > > > I don't want to that to show up again. > > It would really help to know more about that case and fix it properly > > rather than workaround it like this. Anyway, let me think how to handle > > the non-blocking notifier invocation then. I was not able to come up > > with anything remotely sane yet. > > With avoiding allocating memory in the write lock path I don't see an issue > any more with that. > > All what the write lock path does now is adding items to a linked lists, > arrays etc.... Can we change it to non-sleepable lock then? -- Michal Hocko SUSE Labs