From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f200.google.com (mail-wr0-f200.google.com [209.85.128.200]) by kanga.kvack.org (Postfix) with ESMTP id 1B96D6B0429 for ; Wed, 21 Jun 2017 13:43:39 -0400 (EDT) Received: by mail-wr0-f200.google.com with SMTP id p64so7574735wrc.8 for ; Wed, 21 Jun 2017 10:43:39 -0700 (PDT) Received: from mail.skyhub.de (mail.skyhub.de. [5.9.137.197]) by mx.google.com with ESMTP id w145si16435943wmw.126.2017.06.21.10.43.37 for ; Wed, 21 Jun 2017 10:43:37 -0700 (PDT) Date: Wed, 21 Jun 2017 19:43:20 +0200 From: Borislav Petkov Subject: Re: [PATCH v3 04/11] x86/mm: Give each mm TLB flush generation a unique ID Message-ID: <20170621174320.gouuexwzoau6pjnj@pd.tnic> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Sender: owner-linux-mm@kvack.org List-ID: To: Andy Lutomirski Cc: x86@kernel.org, linux-kernel@vger.kernel.org, Linus Torvalds , Andrew Morton , Mel Gorman , "linux-mm@kvack.org" , Nadav Amit , Rik van Riel , Dave Hansen , Arjan van de Ven , Peter Zijlstra On Tue, Jun 20, 2017 at 10:22:10PM -0700, Andy Lutomirski wrote: > - * The x86 doesn't have a mmu context, but > - * we put the segment information here. > + * x86 has arch-specific MMU state beyond what lives in mm_struct. > */ > typedef struct { > + /* > + * ctx_id uniquely identifies this mm_struct. A ctx_id will never > + * be reused, and zero is not a valid ctx_id. > + */ > + u64 ctx_id; > + > + /* > + * 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. > + */ > + atomic64_t tlb_gen; Btw, can this just be a 4-byte int instead? I.e., simply atomic_t. I mean, it should be enough for all the TLB generations in flight, no? -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org