From owner-svn-src-all@freebsd.org Mon Jul 25 21:07:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E2A8BA4F59 for ; Mon, 25 Jul 2016 21:07:15 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-wm0-x229.google.com (mail-wm0-x229.google.com [IPv6:2a00:1450:400c:c09::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E896B1452 for ; Mon, 25 Jul 2016 21:07:14 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-wm0-x229.google.com with SMTP id q128so149612552wma.1 for ; Mon, 25 Jul 2016 14:07:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=FAWMfwkadTr31u2STBe+gTDT9htQmCxlrMTSePbRvHQ=; b=1ovZZPJHwpEd4+fF2td/Pur1Uizaj0K7qHPnpcReOtu/gRl/6kSFlwFi2fhdqnqmPY QxpHcs4rhU4x4Yr1zaVRAQgkXwowhlP0mSPY6/q8tFoQOi/CkuggMAu/7ZAGeR5PydW9 N8uGpUEXHgtfx7NYvQOH/GUzzjRGq+iZAhI4LxcddhvyiTYgkG9/GQynzbpN+3UIITeG YQ59Q3VbDj7k1ZX8Qbs2Dyx2dONYbSNIgd9bpo0c13eFbGLc53lN0jIY5MBeMjPYZzuo pW41gfNt0Ezj0TZSFAmpISZrQAMHo3lkSv0zH+P2ryOjoOxc0HyPUbOKVMFHp8aj9r2l o3Xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=FAWMfwkadTr31u2STBe+gTDT9htQmCxlrMTSePbRvHQ=; b=kW5wplvj9r1Qau2rZ0o8jm5FkC7aYoQASXmYjcSv8FMKAsHnPXbjr10evmi61GPzOC 2hhduUCUs1dUL5JqJb8I7ywSPJinWc/bM22kzWC/ENFBXIoSLwOsjs3vbvrH7Ve8LBMo eeWZDzLcXPkQ3thQk8xodie3yK8n1gFfLwj5pjYhRzLNvCKvv8pAHzEcZQLvHjItHYCr f/GoaDUJejyduSwBEioU0ZOBh3WrdepbqtNPYloZ+9duBvWyo/y6PMIUpLvi+liYCM2N Iwqnt6715IZCnhLMdKlerP1K4lcp9gYOExP8RnrS5o5m/2x1tAtohcS7u/m33sFrRDSM GOmQ== X-Gm-Message-State: AEkoouudggUZKtBbnucM7PWRhlIu4Kpigr4y4gWwMD2nxnAi7u6oOCPnx4k3NQK4t4Vhx9ZhdjBjiH9+uyXltc7C X-Received: by 10.28.17.138 with SMTP id 132mr21272949wmr.81.1469480833366; Mon, 25 Jul 2016 14:07:13 -0700 (PDT) MIME-Version: 1.0 Received: by 10.194.73.99 with HTTP; Mon, 25 Jul 2016 14:07:12 -0700 (PDT) In-Reply-To: <201505091911.t49JB2gh067512@svn.freebsd.org> References: <201505091911.t49JB2gh067512@svn.freebsd.org> From: Oliver Pinter Date: Mon, 25 Jul 2016 23:07:12 +0200 Message-ID: Subject: Re: svn commit: r282684 - in head/sys: amd64/amd64 amd64/include x86/include x86/xen To: Konstantin Belousov Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2016 21:07:15 -0000 On Sat, May 9, 2015 at 9:11 PM, Konstantin Belousov wrote: > Author: kib > Date: Sat May 9 19:11:01 2015 > New Revision: 282684 > URL: https://svnweb.freebsd.org/changeset/base/282684 > > Log: > Rewrite amd64 PCID implementation to follow an algorithm described in > the Vahalia' "Unix Internals" section 15.12 "Other TLB Consistency > Algorithms". The same algorithm is already utilized by the MIPS pmap > to handle ASIDs. > > The PCID for the address space is now allocated per-cpu during context > switch to the thread using pmap, when no PCID on the cpu was ever > allocated, or the current PCID is invalidated. If the PCID is reused, > bit 63 of %cr3 can be set to avoid TLB flush. > > Each cpu has PCID' algorithm generation count, which is saved in the > pmap pcpu block when pcpu PCID is allocated. On invalidation, the > pmap generation count is zeroed, which signals the context switch code > that already allocated PCID is no longer valid. The implication is > the TLB shootdown for the given cpu/address space, due to the > allocation of new PCID. > > The pm_save mask is no longer has to be tracked, which (significantly) > reduces the targets of the TLB shootdown IPIs. Previously, pm_save > was reset only on pmap_invalidate_all(), which made it accumulate the > cpuids of all processors on which the thread was scheduled between > full TLB shootdowns. > > Besides reducing the amount of TLB shootdowns and removing atomics to > update pm_saves in the context switch code, the algorithm is much > simpler than the maintanence of pm_save and selection of the right > address space in the shootdown IPI handler. > > Reviewed by: alc > Tested by: pho > Sponsored by: The FreeBSD Foundation > MFC after: 3 weeks > > Modified: > head/sys/amd64/amd64/apic_vector.S > head/sys/amd64/amd64/cpu_switch.S > head/sys/amd64/amd64/genassym.c > head/sys/amd64/amd64/machdep.c > head/sys/amd64/amd64/mp_machdep.c > head/sys/amd64/amd64/pmap.c > head/sys/amd64/amd64/vm_machdep.c > head/sys/amd64/include/cpufunc.h > head/sys/amd64/include/pcpu.h > head/sys/amd64/include/pmap.h > head/sys/amd64/include/smp.h > head/sys/x86/include/specialreg.h > head/sys/x86/xen/xen_apic.c > > Modified: head/sys/amd64/amd64/apic_vector.S > [snip] Hi! Are you still plan to MFC back these PCID related changes to 10-STABLE, or there is a good reason no merge them back or the MFC was just have forgotten? Thanks, Oliver