Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp517603pxk; Wed, 23 Sep 2020 08:54:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyo4KXvQnokRziZNq6iklScn7AjtLDKSYaxkt7k83E3jvEG5kU/N3Mju7XcmWclynz0+HS3 X-Received: by 2002:a17:907:4035:: with SMTP id nk5mr309776ejb.418.1600876475404; Wed, 23 Sep 2020 08:54:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600876475; cv=none; d=google.com; s=arc-20160816; b=d627z4QjY0IU+3MRBpPNkd3AvO5C6ItThNgOxyzNVAL9IAZRgtILGBlJ2Bx8wlKaHU 02ytW1l8UPHvotpJ+FIeDq++yuvfwapbarR93Id013qUk6IhnTwNNu4R5ewqhY7cN9kA Y1yL2KpOA6hWoqlRCLBA8DwoHeMfaIWR82ESrjMNZ5Tvch6VBNtIWnhUtAjnjvz/ImT6 JTyWprKv6Jc8med1k3VV0qhxgnViRHOb6WoYqEGmf80+XPqwIXhx+qOgT4t3PT0cIZTk LfeOX+eZixgxajk5QK3rO3JyUSOcI58MoUc6AMwnaOLHt105L2iYDCWbBItZexpNfHRJ Fvrg== 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=i6gbHlBUWrpGX/muQ3ZxNoJu+DdOxZL36amwwNWO/MQ=; b=BB5LQUPYO7veU1s3omxQXI8FFaWDq71Pv/NwmIn4O2HxXTWSMQY1QdB2YqYFPzqPQD aturDNr/djwRAgz7W2m7Itewdo6llo4UZCPlsK/83saU/0HlF0AYIGLIBJ2KvvoX+QRX KD5btMqaO4HUjOb+lEA3C6U5Fgtsa2nQnQMcMZQm3ErXF/O0D450Fq+tfBq7v4M+lATC DZRYdOOLqLKzyRpOL96lmoC/81d7BerC+IsWwDWpGoudMlSJ8XR5045NM1RitDjfy1wN zPvcg9ddPllTqHcuw+e2IDW2LSCHNTUr3ihydreGEJtBbvAlsOXbrjTTAhMAVEhf3KJy LgHA== 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 s17si137115edx.593.2020.09.23.08.54.09; Wed, 23 Sep 2020 08:54:35 -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 S1726672AbgIWPxE (ORCPT + 99 others); Wed, 23 Sep 2020 11:53:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:55180 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726130AbgIWPxD (ORCPT ); Wed, 23 Sep 2020 11:53:03 -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 492262223E; Wed, 23 Sep 2020 15:52:54 +0000 (UTC) Date: Wed, 23 Sep 2020 11:52:51 -0400 From: Steven Rostedt To: peterz@infradead.org Cc: Thomas Gleixner , 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: <20200923115251.7cc63a7e@oasis.local.home> In-Reply-To: <20200923084032.GU1362448@hirez.programming.kicks-ass.net> 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> 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 10:40:32 +0200 peterz@infradead.org wrote: > However, with migrate_disable() we can have each task preempted in a > migrate_disable() region, worse we can stack them all on the _same_ CPU > (super ridiculous odds, sure). And then we end up only able to run one > task, with the rest of the CPUs picking their nose. What if we just made migrate_disable() a local_lock() available for !RT? I mean make it a priority inheritance PER CPU lock. That is, no two tasks could do a migrate_disable() on the same CPU? If one task does a migrate_disable() and then gets preempted and the preempting task does a migrate_disable() on the same CPU, it will block and wait for the first task to do a migrate_enable(). No two tasks on the same CPU could enter the migrate_disable() section simultaneously, just like no two tasks could enter a preempt_disable() section. In essence, we just allow local_lock() to be used for both RT and !RT. 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. -- Steve