Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp63115ybl; Thu, 15 Aug 2019 12:42:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqwIbtJdt3Q2zM3G+TnxceL2xNq92QeEQ+B4EhBC8ySiK+G7wy/hTwTtE/8gTD/nE4tg3RI1 X-Received: by 2002:a63:460d:: with SMTP id t13mr4585052pga.205.1565898160575; Thu, 15 Aug 2019 12:42:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565898160; cv=none; d=google.com; s=arc-20160816; b=f+kWWl2pfV/wH6+NXwMRMbUItSEldX6CdjvgMkUGPycwfc8DIaFwa0DU3QtiOiO/06 cagjsVCyIBGVY8fBvsI5L3TeiOoz5Exde6KNU3qG40eoGjlhzrfYS/irX96m0Lv4dZpS LHKwrHxvGAHoIqbiB+RIueHwtVa5UkYp3JxKY6eY0m0KS5FUoJ7YBs3EXNm2Fpn8FKLC YttHM+gH8tzQ5fR6D3Y8R2g57hvP1u2y7mXlQDsNcNNPOqQitrkthSe9XnEftF323CG8 qHFUfONzvJw6EFGBZK4q8r86uYB38G6ZVbTdbZKi4Oth11OZ+bC+b7FfJWgkm/mMnOHD 7shA== 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=z8ffACx97UoCYoWbcK20vb+vJc46Di7ZY3J/Q+sVrN4=; b=WKNA92803MU38o+qcaU1e9khBdJRQRKZXsg3K8wyyz/U52ljLA3v8qY1oQ62rClftV YbRrYiINCuAx9QD7cFDIitV9Dg7OCHc34Mn+yCxoGxeyKgV1ePsylhrcRSAVmwXV1eYH 2d+VVFvAQBPoK7nrJkb/x/KLSzRyF1dV5tInQHaw7fOm4Bm915lzSYhNaAg6F5NW0jqb AZnJq1Nu81kIoNDAOtDFEfVHTbYuklwdaqLhAoswCPmY4IuuyqCcpUvkIb81v5F7i1Yl xLbhD1WlLuxPs+KhWnuh2q7jnEMVeJz8tTMFnepeOp+w3zU0K3hIw8s8AQwJv+HVSzKy t4/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=lrLcqqVV; 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 o13si1529004pjt.11.2019.08.15.12.42.24; Thu, 15 Aug 2019 12:42:40 -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=lrLcqqVV; 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 S1731101AbfHORRv (ORCPT + 99 others); Thu, 15 Aug 2019 13:17:51 -0400 Received: from mail-qt1-f195.google.com ([209.85.160.195]:42373 "EHLO mail-qt1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726098AbfHORRv (ORCPT ); Thu, 15 Aug 2019 13:17:51 -0400 Received: by mail-qt1-f195.google.com with SMTP id t12so3090675qtp.9 for ; Thu, 15 Aug 2019 10:17: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=z8ffACx97UoCYoWbcK20vb+vJc46Di7ZY3J/Q+sVrN4=; b=lrLcqqVVbBaaW5DmpJaOL2mAta1VuHGEWegYy4v8k9O/KYbA6trUfUtSwOXUA310uN zuvisW/tOnzl/qIbzDfd4s3DNn2oJk4o0dxwnY/ZA56xooLiBHwRGX7/e/IRF4uCvJRB gB253hM+6t/Z3jYXj3AHAc09XhS2/PZIrdxHVerl0xsJ/so5ncLIXCUE4xzYVLJEjsPP GkcGuLjNzYWjfCaXPfSyoxq6CfnLddPdNdVqoeGSnNtvn/yy7fnMHG5zCWqXToBvxETG SAyXDrs7d4csk5SF9eMf58/iCQdcp2DH2M7Cmh4WFK4tJIJ45uHTq8hpFiNJmrDGh4h8 A8YQ== 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=z8ffACx97UoCYoWbcK20vb+vJc46Di7ZY3J/Q+sVrN4=; b=M3XsWx9L2n65WUQnr1UwLnXYLOXMc5q5z+vLZCVxfOImZxlwwQWrZz3C6QGrr8ZFon rTueiocENhmPfeNAGcUF1Vgg978Utk/uUoojmNTC30DkTgWFF9XNKo5W3eH4NxNjHeCm 7ubVp68ploiz7OnrYsrxeNIZO1yO9Pog8i/QNFzULrmKPpsF9wIK+cvMIECAldu0ULAt KXoG0q+/4KTabod6P2iZ+hET9JuwuQ4Jaegsw2diG9RJ25pNK9G+gYQ8MtdS/qTDJDGa 5jgdSqUNWtki4E6KHmhBPq+8nY1xWCMuQRuXDCaQ/n7rsOZZ8FNXo05ngqJecl6Iw01A kxFw== X-Gm-Message-State: APjAAAV+jCvK8jMSOB52Fl+KgQBY+6eKodh21KIkZPlZMK/rTI+gv6Vu 1lMSj72FalCaCAoCGZBGxkWQZw== X-Received: by 2002:ac8:6b45:: with SMTP id x5mr4726244qts.329.1565889470494; Thu, 15 Aug 2019 10:17:50 -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 x28sm1853523qtk.8.2019.08.15.10.17.50 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 15 Aug 2019 10:17:50 -0700 (PDT) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1hyJNl-0006n3-Lb; Thu, 15 Aug 2019 14:17:49 -0300 Date: Thu, 15 Aug 2019 14:17:49 -0300 From: Jason Gunthorpe To: Jerome Glisse Cc: Michal Hocko , LKML , linux-mm@kvack.org, DRI Development , Intel Graphics Development , Peter Zijlstra , Ingo Molnar , Andrew Morton , David Rientjes , Christian =?utf-8?B?S8O2bmln?= , 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: <20190815171749.GM21596@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> <20190815171156.GB30916@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190815171156.GB30916@redhat.com> 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 01:11:56PM -0400, Jerome Glisse wrote: > 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. Sorry, I mean remove the idea of the blockable flag from the drivers. Drivers will always be able to block, within the existing limitation of fs_reclaim Jason