Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp618173ybx; Wed, 6 Nov 2019 23:47:52 -0800 (PST) X-Google-Smtp-Source: APXvYqx2o+Rq4oWwXoMXBPmXZc/PZNIvGAcOjjv/nEob6gZEOIUEo9CQGPebhNLDpnypdC8CnWlM X-Received: by 2002:a17:906:a388:: with SMTP id k8mr1614337ejz.223.1573112872562; Wed, 06 Nov 2019 23:47:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573112872; cv=none; d=google.com; s=arc-20160816; b=mx5PP45O6knvpDV5pJtcE7y/cr3ASvp/9SlpO91SRSuVqSUedVLW5MV2mmHZU3FLpH o4H7UZIgO2jCeREit19seScf1dEWr5dMxV9r3ue6mowXroj35SpJEsrmZU1/tm3KHV5G WVX7ZIeOz4aQ9ntJp/Em+zYJGwG24Lo0IYPBJ8N3eDcJ1y4X5BPPPkn91QZjOhOH+rWU FCvTUznXShgdf8zvsGjHFBxjxsK/XcH7DnWwllTrDjm8dodWL0aKSA8eKf1t6OAuIhCh 29IcNSuKFrA4wcpAFVMUAxJFv8OrDZB9JtInR/Of4NWbXQKJsr+7NvoMdHMfdKJ33x81 oDeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=+WrHY7lBvqCDCqBDWRpu2gfVFfz2s0J/sFdNyyXHbC4=; b=sgTqflNYnz6+u2w53UFvD85F3mcUFTIeB+0tUoGNlSMiI+xB44SQ8P/13hMtIYSegd IzblgGWvsqRdjqM/5dp3xfzF2bIFir85PYVJeOpOV1ptsLK1vurtzmLDXUAPTgXhBBbR JU+zLXDBF4+PRu4cn1h8qrM8RhDtzSc+BuJyavBNm79j0JuKLC+9j1nopBsDq2/ka94c ZM8QPXCk6pmsf9MO+5MRcntb7TrM+HvZ0Q95S0Ps0gOvNUsbeTFDmU+kGoq3qmTDm6Xt Hov051+Slrram9c9nShb9m1Qecl1p5gYsTGnr0vF86aUEExc7IER4Xhy1vDwrh521vz+ LE9Q== ARC-Authentication-Results: i=1; mx.google.com; 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 i6si792767eda.30.2019.11.06.23.47.28; Wed, 06 Nov 2019 23:47:52 -0800 (PST) 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; 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 S1726829AbfKGHoy (ORCPT + 99 others); Thu, 7 Nov 2019 02:44:54 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:46340 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726571AbfKGHoy (ORCPT ); Thu, 7 Nov 2019 02:44:54 -0500 Received: from p5b06da22.dip0.t-ipconnect.de ([91.6.218.34] helo=nanos) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1iScTI-0000TF-19; Thu, 07 Nov 2019 08:44:48 +0100 Date: Thu, 7 Nov 2019 08:44:45 +0100 (CET) From: Thomas Gleixner To: Linus Torvalds cc: LKML , the arch/x86 maintainers , Stephen Hemminger , Willy Tarreau , Juergen Gross , Sean Christopherson , "H. Peter Anvin" Subject: Re: [patch 5/9] x86/ioport: Reduce ioperm impact for sane usage further In-Reply-To: Message-ID: References: <20191106193459.581614484@linutronix.de> <20191106202806.241007755@linutronix.de> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 6 Nov 2019, Linus Torvalds wrote: > I may read this patch wrong, but from what I can tell, if we really > have just one process with an io bitmap, we're doing unnecessary > copies. > > If we really have just one process that has an iobitmap, I think we > could just keep the bitmap of that process entirely unchanged. Then, > when we switch away from it, we set the io_bitmap_base to an invalid > base outside the TSS segment, and when we switch back, we set it back > to the valid one. No actual bitmap copies at all. > > So I think that rather than the "begin/end offset" games, we should > perhaps have a "what was the last process that used the IO bitmap for > this TSS" pointer (and, I think, some sequence counter, so that when > the process updates its bitmap, it invalidates that case)? > > Of course, you can do *nboth*, but if we really think that the common > case is "one special process", then I think the begin/end offset is > useless, but a "last bitmap process" would be very useful. > > Am I missing something? No. You are right. I'll have a look at that. Thanks, tglx