Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp337744pxk; Thu, 24 Sep 2020 06:55:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx4ltXs60map87Y2NvXkomkDx2UcB82jV6hyBwqfJRWsdQvJzjbWnRKAxufXOaQ5Qw1xckp X-Received: by 2002:a17:906:6d92:: with SMTP id h18mr1099472ejt.405.1600955719998; Thu, 24 Sep 2020 06:55:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600955719; cv=none; d=google.com; s=arc-20160816; b=xVC+6eD32qaFgW16lWfOZnOhCw97FsFAyNyhmThUk3qKqXYRi6/EwWf3snY9NzSi3c BVNWAcearqTNjEbDdhPYMe2OD+EbBKugEtmV6zFwmdDKq+AHiv4ZSOu4Bs/nomC3/F6T wNCCisTKFELt3Iwvnxo2F42wgZUWnuSamETOax/S53gdGiHa5iY5UcmOyfcmIu8N7GhH dta7cUSNa04cTpP5OP2eVrqLZx7Oq3Wx5CjcFMNtTc82hNtMVtgCdKplgWUzXYY9D9h4 JPzbraQefX53UdO3wBA4irpB9GFOemC8TSUthpIYwBbJyaJ75GNAGEDHPfAhVCEVrwAW 1XNg== 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=MnBn9gooWZydOLtL6UI9w0JBXvS20jpmkp+MRfuO3Tk=; b=wR3Sh51ScmPAGm1I6mytvg6sfZ8n3vgChSrZ+w0wIs74xSaTLv2CtQHNSwxye1yVpQ cSpqMaYKRymzsWWUH4EuiHakQ7hlwBrm5mYfk+pSa0tVqvKt2fJ1EvosbnllFSfdNQUK G7N+5hcKh8u67zrT70z6TvozLak74AQEY2BTuBSAdaFG3kgRkKdcmz4BQoJVuYBuz156 7vhxzOLdMakQp2Ll5Z1bnBUjB8bDfxEmi5tmaGZFhN05BfYexfiXzVshgy5HHFFiLKq+ dp8tDcFEWRiR7xUp25L/cEjYHC7bD2BpYfKF2/z1JN7/A5qL0SXdttal5I+GUrs0sxZ1 6rRw== 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 d10si2332443edp.364.2020.09.24.06.54.55; Thu, 24 Sep 2020 06:55:19 -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 S1728064AbgIXNvp (ORCPT + 99 others); Thu, 24 Sep 2020 09:51:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:59680 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727835AbgIXNvp (ORCPT ); Thu, 24 Sep 2020 09:51:45 -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 C7B5D206CD; Thu, 24 Sep 2020 13:51:39 +0000 (UTC) Date: Thu, 24 Sep 2020 09:51:38 -0400 From: Steven Rostedt To: Peter Zijlstra 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: <20200924095138.5318d242@oasis.local.home> In-Reply-To: <20200924124241.GK2628@hirez.programming.kicks-ass.net> References: <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> <20200923171234.0001402d@oasis.local.home> <871riracgf.fsf@nanos.tec.linutronix.de> <20200924083241.314f2102@gandalf.local.home> <20200924124241.GK2628@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 Thu, 24 Sep 2020 14:42:41 +0200 Peter Zijlstra wrote: > On Thu, Sep 24, 2020 at 08:32:41AM -0400, Steven Rostedt wrote: > > Anyway, instead of blocking. What about having a counter of number of > > migrate disabled tasks per cpu, and when taking a migrate_disable(), and there's > > already another task with migrate_disabled() set, and the current task has > > an affinity greater than 1, it tries to migrate to another CPU? > > That doesn't solve the problem. On wakeup we should already prefer an > idle CPU over one running a (RT) task, but you can always wake more > tasks than there's CPUs around and you'll _have_ to stack at some point. Yes, understood. > > The trick is how to unstack them correctly. We need to detect when a > migrate_disable() task _should_ start running again, and migrate away > whoever is in the way at that point. > > It turns out, that getting selected for pull-balance is exactly that > condition, and clearly a migrate_disable() task cannot be pulled, but we > can use that signal to try and pull away the running task that's in the > way. Unless of course that running task is in a migrate disable section itself ;-) But I guess we will always have that SHC, and there will always be a scenario that you can't balance properly. But hopefully in practice we wont see that. How to handle kmap_local(), will migrate_disable() be used only for 32bit or, for consistency, will it also apply to 64bit? -- Steve