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=-11.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=ham 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 6CB2AC433E0 for ; Sun, 31 Jan 2021 18:26:51 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D03AD60234 for ; Sun, 31 Jan 2021 18:26:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D03AD60234 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 187036B0006; Sun, 31 Jan 2021 13:26:50 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 136F16B006C; Sun, 31 Jan 2021 13:26:50 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 074566B006E; Sun, 31 Jan 2021 13:26:50 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0213.hostedemail.com [216.40.44.213]) by kanga.kvack.org (Postfix) with ESMTP id E5E0B6B0006 for ; Sun, 31 Jan 2021 13:26:49 -0500 (EST) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id A7717181AC553 for ; Sun, 31 Jan 2021 18:26:49 +0000 (UTC) X-FDA: 77766901338.26.trees50_540e2c2275bb Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin26.hostedemail.com (Postfix) with ESMTP id 802441804B667 for ; Sun, 31 Jan 2021 18:26:49 +0000 (UTC) X-HE-Tag: trees50_540e2c2275bb X-Filterd-Recvd-Size: 3942 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf32.hostedemail.com (Postfix) with ESMTP for ; Sun, 31 Jan 2021 18:26:48 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 289DC64E59 for ; Sun, 31 Jan 2021 18:26:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1612117607; bh=MKWpmZEwgflR/tg9uIfU5icINT1Ba4YkYbavbNKWndk=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=u4s+ClkidDrWitAQ+/0lteh7Zggar8KT3j8Z5GNVH8F5+JucR0WWVz5tmg5uI/s57 /JFkFHuGrkBHl80SG8c/ILiuejd2WJpG2SQ06KA0Tg92iIUcMWrOaISMgGvDKP8qTa V683ptPgog2VjhPvtTP4Up79jc1nEFwUvFeCLFneq0ooWY1XK8t5ezIrhLTSOmCdXx M3Td7CsdozgvLc+LOkIcSRXLSgs0xvNN/xF9sQS7PueVxrgw4Ewlx08+FUUCF1vSD0 aRoz43T3PxoxbB04zHRL0Eme9BzvyiRUymhAVQDb1O10mm/13lY7zG9MDOAyy928+X TUMf9DWb2TFhA== Received: by mail-ed1-f47.google.com with SMTP id s5so3472438edw.8 for ; Sun, 31 Jan 2021 10:26:47 -0800 (PST) X-Gm-Message-State: AOAM533zyy+OKCMzHmsAhepijm6q/cbnVZ/IxqjqpzwkYko3iFDO8T4P XOq/yyrLJWtEvQMOxJdG3vT083QdsylWiALpeL9vHg== X-Google-Smtp-Source: ABdhPJxcH/OxKjyA8VB3yDBVpwEhEg/X27LdcUkmTawledJjdB742M6RMRGzViP74t5Yj1thr+1Ob/7dfm/Z/3WZVVU= X-Received: by 2002:aa7:c384:: with SMTP id k4mr15047523edq.23.1612117605566; Sun, 31 Jan 2021 10:26:45 -0800 (PST) MIME-Version: 1.0 References: <20210131001132.3368247-1-namit@vmware.com> <20210131001132.3368247-8-namit@vmware.com> In-Reply-To: <20210131001132.3368247-8-namit@vmware.com> From: Andy Lutomirski Date: Sun, 31 Jan 2021 10:26:34 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC 07/20] mm: move x86 tlb_gen to generic code To: Nadav Amit Cc: Linux-MM , LKML , Nadav Amit , Andrea Arcangeli , Andrew Morton , Andy Lutomirski , Dave Hansen , Peter Zijlstra , Thomas Gleixner , Will Deacon , Yu Zhao , Nick Piggin , X86 ML Content-Type: text/plain; charset="UTF-8" X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Sat, Jan 30, 2021 at 4:16 PM Nadav Amit wrote: > > From: Nadav Amit > > x86 currently has a TLB-generation tracking logic that can be used by > additional architectures (as long as they implement some additional > logic). > > Extract the relevant pieces of code from x86 to general TLB code. This > would be useful to allow to write the next "fine granularity deferred > TLB flushes detection" patches without making them x86-specific. Tentative ACK. My biggest concern about this is that, once it's exposed to core code, people might come up with clever-but-incorrect ways to abuse it. Oh well. > struct workqueue_struct *efi_rts_wq; > diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h > index 0974ad501a47..2035ac319c2b 100644 > --- a/include/linux/mm_types.h > +++ b/include/linux/mm_types.h > @@ -560,6 +560,17 @@ struct mm_struct { > > #ifdef CONFIG_IOMMU_SUPPORT > u32 pasid; > +#endif > +#ifdef CONFIG_ARCH_HAS_TLB_GENERATIONS > + /* > + * Any code that needs to do any sort of TLB flushing for this > + * mm will first make its changes to the page tables, then > + * increment tlb_gen, then flush. This lets the low-level > + * flushing code keep track of what needs flushing. > + * > + * This is not used on Xen PV. That last comment should probably go away.