Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2376500ybl; Thu, 15 Aug 2019 10:48:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqx8+ycmDk6Y8Kj0jlIQg5e+OJo/vsUM0zx4msJb8uJrP8zLESfve7YmbjrABLl5PHVsAOZm X-Received: by 2002:a17:90a:9505:: with SMTP id t5mr3300986pjo.96.1565891299657; Thu, 15 Aug 2019 10:48:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565891299; cv=none; d=google.com; s=arc-20160816; b=z46gy8GbCYX+mVmPCBEvweyxr07e5z1XbidnrYvyVZ6L2wnZ3Vx1UE6CTYb7Mfe6vA vSEWiXCOAq1wPFfc054pzi/dOCiF1qVwbKttOf24wG/tWaNWaKQddHNe8E13X0lEtSMS QN+fGY5vjqGyr+JBC66ibJ3bMNrDZOFIRbGhvkX4jrNeXm5Jj/FnSuuBJ6hD8g5IIMpl /j4wOJUQUVc/bu8J9CNpmF2YZ8cqCd9OM+A3gOkUH3vmt+QJ/WvwCbebPaQjawYwOvHs TlgjVtILVkKdICKGWqAR25iL1NvYPsiHP10vEJ7lSi7D/IJ5cVHYGc90EReJjvTb0awA MGLA== 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; bh=knS8KR0hq91bCj7r1NMutL1F5vEp1kleSvEqlGXJTbo=; b=wGKH0rmH7NSiZC+rqHx7rU31S/Q2tWNoFU4lIueypLTlr175JvmpBsKF4amPXahBuW 7Ufh6Iws5jYbGrOr0VTNrMijrJKh9tgoesI52Rl0RDs/80ypu/Pv+Qp6vH9JFLfRO0LZ CZIPwiRaWp7zuhCIQRETRQExRQANo/D8PdsB4A4HWSaB/4gw09gFHmPeRSKTSUwM600E 5nBPYzpwDv6x3FYDZ6pYI7AjrkH+8R4qT/yOluMd37qk2bOMixp3TRBetu9sNWSY400Z fvpb/lVuTmgD5x8WvlcJaiZuO4U+LvEOnlsFr9FgWF72VSI10Gp09Z8ixjV9eDwkjsi7 dhhA== 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a65si2198256pgc.213.2019.08.15.10.48.03; Thu, 15 Aug 2019 10:48:19 -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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731370AbfHORMB (ORCPT + 99 others); Thu, 15 Aug 2019 13:12:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:20203 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730474AbfHORMB (ORCPT ); Thu, 15 Aug 2019 13:12:01 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 732FD30832E1; Thu, 15 Aug 2019 17:12:00 +0000 (UTC) Received: from redhat.com (unknown [10.20.6.178]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9562687A9; Thu, 15 Aug 2019 17:11:58 +0000 (UTC) Date: Thu, 15 Aug 2019 13:11:56 -0400 From: Jerome Glisse To: Jason Gunthorpe Cc: Michal Hocko , LKML , linux-mm@kvack.org, DRI Development , Intel Graphics Development , Peter Zijlstra , Ingo Molnar , Andrew Morton , David Rientjes , Christian =?iso-8859-1?Q?K=F6nig?= , 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: <20190815171156.GB30916@redhat.com> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190815165631.GK21596@ziepe.ca> User-Agent: Mutt/1.11.3 (2019-02-01) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Thu, 15 Aug 2019 17:12:00 +0000 (UTC) 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 01:56:31PM -0300, 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. > > > If you can express that in the existing lockdep machinery. All > > fine. But then consider deployments where lockdep is no-no because > > of the overhead. > > This is all for driver debugging. The point of lockdep is to find all > these paths without have to hit them as actual races, using debug > kernels. > > I don't think we need this kind of debugging on production kernels? > > > > The best we got was drivers tested the VA range and returned success > > > if they had no interest. Which is a big win to be sure, but it looks > > > like getting any more is not really posssible. > > > > And that is already a great win! Because many notifiers only do care > > about particular mappings. Please note that backing off unconditioanlly > > will simply cause that the oom reaper will have to back off not doing > > any tear down anything. > > Well, I'm working to propose that we do the VA range test under core > mmu notifier code that cannot block and then we simply remove the idea > of blockable from drivers using this new 'range notifier'. > > I think this pretty much solves the concern? I am not sure i follow what you propose here ? Like i pointed out in another email for GPU we do need to be able to sleep (we might get lucky and not need too but this is runtime thing) within notifier range_start callback. This has been something allow by notifier since it has been introduced in the kernel. Cheers, J?r?me