Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp7697ybl; Thu, 15 Aug 2019 11:38:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqx+4LBkP7bCi531dmXmhsFQCc0cwoABoxAJ43I1gJDzuZqY53arqa/MJPBrmx+tyXGFzFA3 X-Received: by 2002:aa7:9abc:: with SMTP id x28mr6933664pfi.234.1565894322603; Thu, 15 Aug 2019 11:38:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565894322; cv=none; d=google.com; s=arc-20160816; b=HWJiQNNgfE0noYakq8wjeEiwhSBCEiXIn9IBVnB3S1nubHFd8VTzGwO5MbSbF5ESDR 6wXoujtQnvPX6fvjfGrNpVnemBkCimnpWJJtcvHWMCmJ5wMI1Em5338XiMOX2zfogK2A XqOWX1AHk7QFNvmWy3usoDUfBV3BCnqvuBR41pc85fyT+QA7qT1DTvUXjiojfIsoOYpP //OqtIGeX16YY6xEsYBqO5oq00IQIvUXZ+ZXt3RlXR/BQhvrX+p0Nni7snWCrDc88Sy1 OlxR2co62q/+z8c/0d2cxDCMKEwZi794DAIFJ/kJAXZWDQ9nweSFoh8ji1XDsJw87d2b lj2Q== 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-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=G4JHudwK1l0Pa0YXZDZdUoarWmEaiz0kaB3NPKkUFrY=; b=m8k4q6ULYdXBo/VWqNbWnNrH2Y9KZkb9A8kILORqh/5AWqqLhqHmmTr9wHkabJ2oSZ zn/oewOX9rvf9e29X2fvQ9hcolFZKwypJPnGHc0wNLh4L/ujNqtah6p+9Ctxc5uO7TOG oruKMOnn3HWOv5SrL4bNt79tsUR0CcxEYay0TvVU5tE0x50dVMfNVrbjSyfo9MA50AZL UEiPi/gxTi5nSEtyLwNY3hs4pWkyY1MNcTkkZfeh1QTrMW7F88XVwCn4VO7+FTmKiI2F 9efHofKCEXu52dZf1m76vog+LHsggSpoWDGlJHyTQfPOHh8JqT1IG0PM05qdA07uyAJo qmKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=UwFqsKZi; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z12si1401342pjr.58.2019.08.15.11.38.27; Thu, 15 Aug 2019 11:38:42 -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; dkim=pass header.i=@ziepe.ca header.s=google header.b=UwFqsKZi; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732940AbfHOSYv (ORCPT + 99 others); Thu, 15 Aug 2019 14:24:51 -0400 Received: from mail-qk1-f195.google.com ([209.85.222.195]:42906 "EHLO mail-qk1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729121AbfHOSYu (ORCPT ); Thu, 15 Aug 2019 14:24:50 -0400 Received: by mail-qk1-f195.google.com with SMTP id 201so2578280qkm.9 for ; Thu, 15 Aug 2019 11:24:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=G4JHudwK1l0Pa0YXZDZdUoarWmEaiz0kaB3NPKkUFrY=; b=UwFqsKZiJqRFsggeYnYEJQ5ti/D+4zJ6BdWzCQ9+5ZVyFzNT0pZp3Z47GysMlVkWVa s6il5o0C2XSsvu08linHUpE1UuKtws+6kl5bvb6N8JTjKYNm+ZFsMF/aS7KIuwXwY5PL ifLaV1KikbFHjyWGyYq9j2pnPvRA3ulCCU5LBrDPRPTf00Ev8+G4r7ZG1fWssXt+dt8m fSIEjUyPUUjE4Cyc7v3Mk2yhOmcAHNWHAjyBbiBB5PDt75HzpgPI6NlB4kYJlFCHPv45 rERv+1byueCget/MOMNWxs6jcSzjmerqYaJGXU5V9yIGrPZkmI1GoIgdy70yvzXm/v2/ F53g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=G4JHudwK1l0Pa0YXZDZdUoarWmEaiz0kaB3NPKkUFrY=; b=FpsWwcFiYS0sgsMOmsWfH7CNu7hentqRzN2KzFK3RVSFhUDQ7LX8sS1wyC11b6SfFV KKrrSGZ2b58tcqypZqvYMZuEutmjwbyVJ+quHiSEqiVfMXVEzQlEnrU7HjXuxOqAf6F2 CeQ1mFUkpBH22/UnMkV38+VXlhs9UHYGJv0y+yMlxnLZFNLVYKpZV7fiCXo4Od8Y1RaU EjNWR30Voh1CI5C2aHCrR7vivC3W2Vc8j2QO6dA+A1Hi4ZzXYeEORZ4UTHVzxiSliO6f p1PwZF6WPSn/bzHD8Jz0ILRWW/C1Wz/QgoTWmVeD6B4mxCKwNGzbpFpVGgIPhQU8p1ed TSIw== X-Gm-Message-State: APjAAAUIed3fS5ptylUapLaF+9r5MK1lHPseNAhpDwqcyusbzEBvEzWY OXZdbpeFSN7LvCPbd7xZViXKsw== X-Received: by 2002:a37:ef1a:: with SMTP id j26mr5561517qkk.474.1565893489768; Thu, 15 Aug 2019 11:24:49 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-156-34-55-100.dhcp-dynamic.fibreop.ns.bellaliant.net. [156.34.55.100]) by smtp.gmail.com with ESMTPSA id g3sm1745991qke.105.2019.08.15.11.24.48 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 15 Aug 2019 11:24:48 -0700 (PDT) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1hyKQa-0007R9-AO; Thu, 15 Aug 2019 15:24:48 -0300 Date: Thu, 15 Aug 2019 15:24:48 -0300 From: Jason Gunthorpe To: Michal Hocko Cc: LKML , linux-mm@kvack.org, DRI Development , Intel Graphics Development , Peter Zijlstra , Ingo Molnar , Andrew Morton , David Rientjes , Christian =?utf-8?B?S8O2bmln?= , =?utf-8?B?SsOpcsO0bWU=?= Glisse , Masahiro Yamada , Wei Wang , Andy Shevchenko , Thomas Gleixner , Jann Horn , Feng Tang , Kees Cook , Randy Dunlap , Daniel Vetter Subject: Re: [PATCH 2/5] kernel.h: Add non_block_start/end() Message-ID: <20190815182448.GP21596@ziepe.ca> References: <20190814202027.18735-1-daniel.vetter@ffwll.ch> <20190814202027.18735-3-daniel.vetter@ffwll.ch> <20190814235805.GB11200@ziepe.ca> <20190815065829.GA7444@phenom.ffwll.local> <20190815122344.GA21596@ziepe.ca> <20190815132127.GI9477@dhcp22.suse.cz> <20190815141219.GF21596@ziepe.ca> <20190815155950.GN9477@dhcp22.suse.cz> <20190815165631.GK21596@ziepe.ca> <20190815174207.GR9477@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190815174207.GR9477@dhcp22.suse.cz> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 15, 2019 at 07:42:07PM +0200, Michal Hocko wrote: > On Thu 15-08-19 13:56:31, Jason Gunthorpe wrote: > > On Thu, Aug 15, 2019 at 06:00:41PM +0200, Michal Hocko wrote: > > > > > > AFAIK 'GFP_NOWAIT' is characterized by the lack of __GFP_FS and > > > > __GFP_DIRECT_RECLAIM.. > > > > > > > > This matches the existing test in __need_fs_reclaim() - so if you are > > > > OK with GFP_NOFS, aka __GFP_IO which triggers try_to_compact_pages(), > > > > allocations during OOM, then I think fs_reclaim already matches what > > > > you described? > > > > > > No GFP_NOFS is equally bad. Please read my other email explaining what > > > the oom_reaper actually requires. In short no blocking on direct or > > > indirect dependecy on memory allocation that might sleep. > > > > It is much easier to follow with some hints on code, so the true > > requirement is that the OOM repear not block on GFP_FS and GFP_IO > > allocations, great, that constraint is now clear. > > I still do not get why do you put FS/IO into the picture. This is really > about __GFP_DIRECT_RECLAIM. Like I said this is complicated, translating "no blocking on direct or indirect dependecy on memory allocation that might sleep" into GFP flags is hard for us outside the mm community. So the contraint here is no __GFP_DIRECT_RECLAIM? I bring up FS/IO because that is what Tejun mentioned when I asked him about reclaim restrictions, and is what fs_reclaim_acquire() is already sensitive too. It is pretty confusing if we have places using the word 'reclaim' with different restrictions. :( > > CPU0 CPU1 > > mutex_lock() > > kmalloc(GFP_KERNEL) > > no I mean __GFP_DIRECT_RECLAIM here. > > > mutex_unlock() > > fs_reclaim_acquire() > > mutex_lock() <- illegal: lock dep assertion > > I cannot really comment on how that is achieveable by lockdep. ??? I am trying to explain this is already done and working today. The above example will already fault with lockdep enabled. This is existing debugging we can use and improve upon rather that invent new debugging. Jason