Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752747AbaDVBGo (ORCPT ); Mon, 21 Apr 2014 21:06:44 -0400 Received: from mail-ve0-f181.google.com ([209.85.128.181]:61971 "EHLO mail-ve0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752516AbaDVBGk (ORCPT ); Mon, 21 Apr 2014 21:06:40 -0400 MIME-Version: 1.0 In-Reply-To: <1dbe8155-58da-45c2-9dc0-d9f4b5a6e643@email.android.com> References: <1398120472-6190-1-git-send-email-hpa@linux.intel.com> <5355A9E9.9070102@zytor.com> <1dbe8155-58da-45c2-9dc0-d9f4b5a6e643@email.android.com> From: Andrew Lutomirski Date: Mon, 21 Apr 2014 18:06:19 -0700 Message-ID: Subject: Re: [PATCH] x86-64: espfix for 64-bit mode *PROTOTYPE* To: "H. Peter Anvin" Cc: "H. Peter Anvin" , Linux Kernel Mailing List , Linus Torvalds , Ingo Molnar , Alexander van Heukelum , Konrad Rzeszutek Wilk , Boris Ostrovsky , Borislav Petkov , Arjan van de Ven , Brian Gerst , Alexandre Julliard , Andi Kleen , Thomas Gleixner Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 21, 2014 at 5:53 PM, H. Peter Anvin wrote: > Well, if 2^17 CPUs are allocated we might 2K pages allocated. We could easily do a bitmap here, of course. NR_CPUS/64 is a small number, and would reduce the code complexity. > Even simpler: just get rid of the check entirely. That is, break out of the higher level loops once one of them is set (this should be a big speedup regardless) and don't allocate the page if the first PTE is already pointing at something. After all, espfix_already_there is mostly a duplicate of init_espfix_cpu. --Andy -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/