Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp724567ybl; Thu, 22 Aug 2019 04:01:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqwC+zXf5Ol0aYHh8B5MdmUM06eKktEpzSfReW85EKBOWKD3O5SFaFCpLNrBLKa/1OjA579z X-Received: by 2002:a17:902:2b87:: with SMTP id l7mr5104744plb.165.1566471704054; Thu, 22 Aug 2019 04:01:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566471704; cv=none; d=google.com; s=arc-20160816; b=ZtS2JvXi/DyFiDNGX/4ckDJSZkZSEPrC8WYNE0PHaNN0sPPHtlhmQMZxX//KkvOXKD pahsacA8T8B/aUDvQBrjSsCZ/T8CsZ0767MTca/5Uyn+2Xv6bXbSVdA+XyrN90dxbWjX KcZ/PE9P6Tv5vIbx9FaGpkD8iOZ+jxk8fW/N8JX76N61YEEI2tCX0pYwsThlWddc91qI eo+VzcOBgEaUPEHqycnCplNCxgVlv634LKAYu4gLJ92nhP+mw9m/91CnWGig7rB8tTCj f/holw7xGx98jkfKAPzOL0yTzT+2qFZosZjKDPAJbC03NQXs5EWTXvGNNaZ1TVRHfS7H WaMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=NfCKuFdEeNBAgpgY3GQU9evNY2kKtJpvRWsNwL+v9LE=; b=Hjmo5ldHMnm2wf3XKR9QqAZL8GVxeMb7IetUlpaRBxHF+r6WvVl/2NQtTr9Anlgqgi eTpzxMbnI6En+81APwHR+xqr0qCniY1ix2UQvCOPnBi97VLLQd8TZ0dSCRnXEswVvipL jjFs62naNc/ZTmzTkk2+tP4yY0WePjsK0QFs3kcenZE9sDLyZykM8FF1CwDPLW7i9jSj SgJhFjIk07mUNNEQxkaXF5WiVZgapnUY8NFWlhJz2v4Dtx/1JJg99Bx8he5XvVw1Hvko 00gHPQDSH6gOcAgL+UE5otdAlhRzD90ceQPgrqxUbmy0Y5e1tBkRWDIMVHrcnuhjIjJZ aVVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b="cbZ/eIqa"; 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 t13si17945311pfh.245.2019.08.22.04.01.27; Thu, 22 Aug 2019 04:01:44 -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=@ffwll.ch header.s=google header.b="cbZ/eIqa"; 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 S1732537AbfHVImx (ORCPT + 99 others); Thu, 22 Aug 2019 04:42:53 -0400 Received: from mail-ot1-f67.google.com ([209.85.210.67]:37458 "EHLO mail-ot1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732530AbfHVImv (ORCPT ); Thu, 22 Aug 2019 04:42:51 -0400 Received: by mail-ot1-f67.google.com with SMTP id f17so4753679otq.4 for ; Thu, 22 Aug 2019 01:42:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=NfCKuFdEeNBAgpgY3GQU9evNY2kKtJpvRWsNwL+v9LE=; b=cbZ/eIqa3UOnq5kZcw9ViWpQlwY6IoHQWwYFtH4j5KLaJRU0py33AbPiPiAJVlbc/Y BKVPPwYWmhbkGDR1ys452Hfk/wY38q87dT/NiRbDk43nh9KoZQCtcGVi2a+huvT45BW1 DTkTcnHBZzI/xbpSr6wkE8INN5L/ml6Sq3+ak= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=NfCKuFdEeNBAgpgY3GQU9evNY2kKtJpvRWsNwL+v9LE=; b=JDlQaI5/q/ZJlNX7k8MSSZjfQ+9PxLa15ajBOgQm9L7ABYU5ZAvRzF0A8zftim/rkY qtJ0UhZjrOJVjDchW7mKzlvsK6wYki22ckpTdUo4u0nrK9757qppD5UrZsY8reAVMOq6 X7mpb6o2tEV5PTKuAlufqdXXvPIGfqKKTW0X/nC6rIs0qrQVa87ZDCg7NCS7iSS780lq dH1dh9By5Mfof9kKgia4KliKKV6G3tnTvKps7dRjP6Y8uB8n1KmfZP4oSG66ndZ0BsHc agQ+gzZAOLTAlBECMdmwAcfbt1z0SmEyxbu1rfB8tsafKh9z/WzM2IUOrS5J6gtB8Io6 zwaw== X-Gm-Message-State: APjAAAXZSV3Pm0u/TBkO8hTUXEhkKwpkt5AV451e7J6WZeniOEphmuuX 2SS3LYlWvJbVCRFF7ndNPpRZcKWVD3YIG6rh3yMt8Q== X-Received: by 2002:a9d:7cc9:: with SMTP id r9mr31457513otn.188.1566463370802; Thu, 22 Aug 2019 01:42:50 -0700 (PDT) MIME-Version: 1.0 References: <20190820081902.24815-1-daniel.vetter@ffwll.ch> <20190820081902.24815-5-daniel.vetter@ffwll.ch> <20190820133418.GG29246@ziepe.ca> <20190820151810.GG11147@phenom.ffwll.local> <20190821154151.GK11147@phenom.ffwll.local> <20190821161635.GC8653@ziepe.ca> In-Reply-To: <20190821161635.GC8653@ziepe.ca> From: Daniel Vetter Date: Thu, 22 Aug 2019 10:42:39 +0200 Message-ID: Subject: Re: [PATCH 4/4] mm, notifier: Catch sleeping/blocking for !blockable To: Jason Gunthorpe Cc: LKML , Linux MM , DRI Development , Intel Graphics Development , Andrew Morton , Michal Hocko , David Rientjes , =?UTF-8?Q?Christian_K=C3=B6nig?= , =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , Daniel Vetter Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 22, 2019 at 10:16 AM Jason Gunthorpe wrote: > > On Wed, Aug 21, 2019 at 05:41:51PM +0200, Daniel Vetter wrote: > > > > Hm, I thought the page table locks we're holding there already prevent any > > > sleeping, so would be redundant? But reading through code I think that's > > > not guaranteed, so yeah makes sense to add it for invalidate_range_end > > > too. I'll respin once I have the ack/nack from scheduler people. > > > > So I started to look into this, and I'm a bit confused. There's no > > _nonblock version of this, so does this means blocking is never allowed, > > or always allowed? > > RDMA has a mutex: > > ib_umem_notifier_invalidate_range_end > rbt_ib_umem_for_each_in_range > invalidate_range_start_trampoline > ib_umem_notifier_end_account > mutex_lock(&umem_odp->umem_mutex); > > I'm working to delete this path though! > > nonblocking or not follows the start, the same flag gets placed into > the mmu_notifier_range struct passed to end. Ok, makes sense. I guess that also means the might_sleep (I started on that) in invalidate_range_end also needs to be conditional? Or not bother with a might_sleep in invalidate_range_end since you're working on removing the last sleep in there? > > From a quick look through implementations I've only seen spinlocks, and > > one up_read. So I guess I should wrape this callback in some unconditional > > non_block_start/end, but I'm not sure. > > For now, we should keep it the same as start, conditionally blocking. > > Hopefully before LPC I can send a RFC series that eliminates most > invalidate_range_end users in favor of common locking.. Thanks, Daniel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch