Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp714706pxk; Wed, 23 Sep 2020 14:13:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy35sXPBpM5aT6iF0/nqQ+30oy86ri7rOwe/hiw9B3dkZ9YMouPyI6Qx81CcErK5UsKQJpt X-Received: by 2002:a17:906:4754:: with SMTP id j20mr1559561ejs.293.1600895638652; Wed, 23 Sep 2020 14:13:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600895638; cv=none; d=google.com; s=arc-20160816; b=UA9VvHanILCHm5nxVY7vRpymT8heHLl7wmt8n75KX48zIoM6OWfSgK9viOkkwiGIqT pPSTGiJxha8hn7TJyJfnprLQ5+5CveM5G+86JBijGER6we0lKNsP7sVHLgii8oedUJSL CaCbddpQ3tuk/R61gUQYqdti+DGJQAucdWgbaE2gg5yxaWSfQu0G7MhT4O+CEzjE4NwL wpN4uEbH6hTJYI2R/gTO070mOGrhK3gOVz4d/m2vvgnoxXHM2gA5Hz7rGNryHe3mKGrh +72nOYlJWGOea0ehYzes3mNHminy/wBa52qZvw7abzmCatluTMA2oSAxSS16jwRPN/zp irJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=eeDYzDQpZKkyxeNF1Wck8VatrCwPDSsDFJkY4dD9Srs=; b=VVMg9QhvAZHeq5oetp+m9wW4WPYeaaKW/Matih+r5RNbYZX58SkHQ+OW+IodNhpulF gqEoCuHeaWw6vz6MZobCJu0tHXziPGQj7qCRF/OL6T50TUWV3D3L1sjALNHLdxqF7oWJ GpJLTZnFvifdbvyNAWdzxmUqmY9XMkv6P7GNznJUvfs8Nmzbn/byq+vFEWAVv0yL30Di Xe0ruVtwF34emM3pQxMgpzPbvkj8pndt2pQ8Ym6BgowZSjH9eGHxciM3FP/fR7zpDlde bktt1WBuNNAquWCXFejj9DSnetL5SY+wLgixV3kv3csRldZbPAUvNaOiBFr5SQnNXU7q kxrA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jo13si687967ejb.200.2020.09.23.14.13.34; Wed, 23 Sep 2020 14:13:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726596AbgIWVMm (ORCPT + 99 others); Wed, 23 Sep 2020 17:12:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:50774 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726381AbgIWVMl (ORCPT ); Wed, 23 Sep 2020 17:12:41 -0400 Received: from oasis.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0CA3D2145D; Wed, 23 Sep 2020 21:12:35 +0000 (UTC) Date: Wed, 23 Sep 2020 17:12:34 -0400 From: Steven Rostedt To: Thomas Gleixner Cc: peterz@infradead.org, Linus Torvalds , LKML , linux-arch , Paul McKenney , the arch/x86 maintainers , Sebastian Andrzej Siewior , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Will Deacon , Andrew Morton , Linux-MM , Russell King , Linux ARM , Chris Zankel , Max Filippov , linux-xtensa@linux-xtensa.org, Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , David Airlie , Daniel Vetter , intel-gfx , dri-devel , Ard Biesheuvel , Herbert Xu , Vineet Gupta , "open list\:SYNOPSYS ARC ARCHITECTURE" , Arnd Bergmann , Guo Ren , linux-csky@vger.kernel.org, Michal Simek , Thomas Bogendoerfer , linux-mips@vger.kernel.org, Nick Hu , Greentime Hu , Vincent Chen , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , linuxppc-dev , "David S. Miller" , linux-sparc Subject: Re: [patch RFC 00/15] mm/highmem: Provide a preemptible variant of kmap_atomic & friends Message-ID: <20200923171234.0001402d@oasis.local.home> In-Reply-To: <874kno9pr9.fsf@nanos.tec.linutronix.de> References: <20200919091751.011116649@linutronix.de> <87mu1lc5mp.fsf@nanos.tec.linutronix.de> <87k0wode9a.fsf@nanos.tec.linutronix.de> <87eemwcpnq.fsf@nanos.tec.linutronix.de> <87a6xjd1dw.fsf@nanos.tec.linutronix.de> <87sgbbaq0y.fsf@nanos.tec.linutronix.de> <20200923084032.GU1362448@hirez.programming.kicks-ass.net> <20200923115251.7cc63a7e@oasis.local.home> <874kno9pr9.fsf@nanos.tec.linutronix.de> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 23 Sep 2020 22:55:54 +0200 Thomas Gleixner wrote: > > Perhaps make migrate_disable() an anonymous local_lock()? > > > > This should lower the SHC in theory, if you can't have stacked migrate > > disables on the same CPU. > > I'm pretty sure this ends up in locking hell pretty fast and aside of > that it's not working for scenarios like: > > kmap_local(); > migrate_disable(); > ... > > copy_from_user() > -> #PF > -> schedule() > > which brought us into that discussion in the first place. You would stop > any other migrate disable user from running until the page fault is > resolved... Then scratch the idea of having anonymous local_lock() and just bring local_lock in directly? Then have a kmap local lock, which would only block those that need to do a kmap. Now as for migration disabled nesting, at least now we would have groupings of this, and perhaps the theorists can handle that. I mean, how is this much different that having a bunch of tasks blocked on a mutex with the owner is pinned on a CPU? migrate_disable() is a BKL of pinning affinity. If we only have local_lock() available (even on !RT), then it makes the blocking in groups. At least this way you could grep for all the different local_locks in the system and plug that into the algorithm for WCS, just like one would with a bunch of mutexes. -- Steve