Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp4207010ybl; Tue, 20 Aug 2019 08:28:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqzIl4l7oWBVIXFpWQGgkWV/YKU52nsuV0HBOFXkyPjfOj0E+qluA3rInpagTvhDA78KA/SA X-Received: by 2002:a63:60d1:: with SMTP id u200mr25333451pgb.439.1566314913644; Tue, 20 Aug 2019 08:28:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566314913; cv=none; d=google.com; s=arc-20160816; b=06gAgikPl1MKP2B2liSWPtT9Brka5jIWKLH98OL+zPsJwi7V09LEkblptk45y6mYcj okC9pIXbME3MQaihm2Kcu+jHIbWS0m8YEUQISwLgBH2qFkpeyqydyDQwQFg4pma2EosU cHf7fm/TL0EYZeQ8iOKQkVjQhQO/qf5+CrXCn41AK8JkcLWYy3zFicQpqyY1/huKVnEy B7d5l6Q2IIaT00vf0i2UE/SdsfF2E0BsryCFYMfWxfoMaMLsNCNJ42DEX0e/7A1kdwAi SVyUnzCYcTLkfiUHdshISNXtllK7g5Wn7T0E/DPlegKirVd39oeD+RhycDupnYav4iNw LBbg== 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:to :from:date:dkim-signature; bh=yW4ipw+ijUAP2Q3jnbjwYqx48ceAaeyZl32HjbZvBF8=; b=1Jg9LrlxwrdrhxQcjXVqBkAka1AP12mVgzvtFOZ0jWIOil7KuzvuQIg5X0+JGtJEpl BxdSiw9QaHB/kMdy5GN9mJmcE3+4HJLnB5UN8qSd/aQN7FzeuaML81wOIRKJYmJA4Nv8 GlrSndsHvwm08PXU/MA4x7pzXaPc0NHPaqCDYxoa7w6sMho1WRUrn6GG0VuN9iB0LB+k fWEjS4kKwdMsJ4RHylrM3JJy/E+Abx+Gn0L3k9Hx7iPdXV8ATSngdO0hnaQU9Dxl+F+J plb2ICLX7PpRQSt9xZhjLA20NMxpKEZBDyXkSEcSTqMg8q2hGoZFR5FpDcYWz1N/sOla tQog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=QqsPJhXR; 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 y27si13600942pff.50.2019.08.20.08.28.17; Tue, 20 Aug 2019 08:28:33 -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=QqsPJhXR; 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 S1730383AbfHTP1O (ORCPT + 99 others); Tue, 20 Aug 2019 11:27:14 -0400 Received: from mail-qt1-f194.google.com ([209.85.160.194]:39745 "EHLO mail-qt1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727006AbfHTP1O (ORCPT ); Tue, 20 Aug 2019 11:27:14 -0400 Received: by mail-qt1-f194.google.com with SMTP id l9so6468292qtu.6 for ; Tue, 20 Aug 2019 08:27:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=yW4ipw+ijUAP2Q3jnbjwYqx48ceAaeyZl32HjbZvBF8=; b=QqsPJhXRoBXVjmCrsAFdhiaITVfXqO2ZbJBdqsS+9/ZmosuBXqYxWmNMrXR9TnpuUi QlLlAbE7omSK3rDBbAA43cD05WXgrc1Cd6jrfMZkVfD3xtp91Pks6Q/39uGWa+yOwJ/U x4/6+nJFRPi5XiAxs8pJ0RCXRx4TaUPN34lZQGHafrWL31jEoG5n4NHsJbl1H3ahi4kl XvIe+6IfT7lC6koxxwohKTu2HPDLEzE7wDyPYYD4R51boRvsJeGqsyrtz9tg4s0g9Iqq c0bs9IDpm44eGml2+iL4uiImn7byYZ5Mvqulc8EmX+SnUiDF8j9kAMFrtlLv8QR2lihE 8hmQ== 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:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=yW4ipw+ijUAP2Q3jnbjwYqx48ceAaeyZl32HjbZvBF8=; b=HuW1RveqItJbZUDsnWodyTrrhvgHhqBide4G+h1MbkVXXNN6DctWh/NwVjLs0Bl7T9 IxBkxLYbPouKyiWlZH9aIBfqXHdd59e0aRTrTapV03Usqr88DxfW9gl5tJ7Xs6SSmDgA co4Khk0g7t9VbyXhF69w2WW/exulUgXgjlm2KlgdZLlaJNwP1nuP5tnpUIgbgxgTrdZm Fq22uli1tDr7j0AnOTUAi/VeurPCW72swWWFEZb4koQf+iN8GU0sjiDt6kacvQGM5aqK AMtPEoCgUSVOGQONKQW53S1ogsbCFuOEywAItnTKyuuFSdY8/wLQDpbCm7fobs8gusHo +3mw== X-Gm-Message-State: APjAAAWndUAcltJbyr8AywWtjSty+UOmMpiDVPA4/Z4ODDgcPiQg04UH KXNHYnt+GoyI+w4LziEqXKSJIpk9OBg= X-Received: by 2002:ac8:48c1:: with SMTP id l1mr27197055qtr.251.1566314833307; Tue, 20 Aug 2019 08:27:13 -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 d12sm8931802qkk.39.2019.08.20.08.27.12 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 20 Aug 2019 08:27:12 -0700 (PDT) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1i062S-0000PN-G3; Tue, 20 Aug 2019 12:27:12 -0300 Date: Tue, 20 Aug 2019 12:27:12 -0300 From: Jason Gunthorpe To: LKML , Linux MM , DRI Development , Intel Graphics Development , Andrew Morton , Michal Hocko , David Rientjes , Christian =?utf-8?B?S8O2bmln?= , =?utf-8?B?SsOpcsO0bWU=?= Glisse , Daniel Vetter Subject: Re: [PATCH 4/4] mm, notifier: Catch sleeping/blocking for !blockable Message-ID: <20190820152712.GH29246@ziepe.ca> References: <20190820081902.24815-1-daniel.vetter@ffwll.ch> <20190820081902.24815-5-daniel.vetter@ffwll.ch> <20190820133418.GG29246@ziepe.ca> <20190820151810.GG11147@phenom.ffwll.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190820151810.GG11147@phenom.ffwll.local> 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 Tue, Aug 20, 2019 at 05:18:10PM +0200, Daniel Vetter wrote: > > > diff --git a/mm/mmu_notifier.c b/mm/mmu_notifier.c > > > index 538d3bb87f9b..856636d06ee0 100644 > > > +++ b/mm/mmu_notifier.c > > > @@ -181,7 +181,13 @@ int __mmu_notifier_invalidate_range_start(struct mmu_notifier_range *range) > > > id = srcu_read_lock(&srcu); > > > hlist_for_each_entry_rcu(mn, &range->mm->mmu_notifier_mm->list, hlist) { > > > if (mn->ops->invalidate_range_start) { > > > - int _ret = mn->ops->invalidate_range_start(mn, range); > > > + int _ret; > > > + > > > + if (!mmu_notifier_range_blockable(range)) > > > + non_block_start(); > > > + _ret = mn->ops->invalidate_range_start(mn, range); > > > + if (!mmu_notifier_range_blockable(range)) > > > + non_block_end(); > > > > If someone Acks all the sched changes then I can pick this for > > hmm.git, but I still think the existing pre-emption debugging is fine > > for this use case. > > Ok, I'll ping Peter Z. for an ack, iirc he was involved. > > > Also, same comment as for the lockdep map, this needs to apply to the > > non-blocking range_end also. > > Hm, I thought the page table locks we're holding there already prevent any > sleeping, so would be redundant? AFAIK no. All callers of invalidate_range_start/end pairs do so a few lines apart and don't change their locking in between - thus since start can block so can end. Would love to know if that is not true?? Similarly I've also been idly wondering if we should add a 'might_sleep()' to invalidate_rangestart/end() to make this constraint clear & tested to the mm side? Jason