From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9B28AC5DF60 for ; Thu, 7 Nov 2019 07:44:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6DD9621D79 for ; Thu, 7 Nov 2019 07:44:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726897AbfKGHoy (ORCPT ); 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