Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp491617pxk; Thu, 1 Oct 2020 07:25:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy8EAXbJnQCjEUbpCyrDJCLVcynZn17AduPB2mgTXmB6EjBPG5jlfVMTeBX2/hDqvSsVOAI X-Received: by 2002:aa7:da89:: with SMTP id q9mr8336057eds.111.1601562343909; Thu, 01 Oct 2020 07:25:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601562343; cv=none; d=google.com; s=arc-20160816; b=RKGSttqtcy37kiCEXB5N7lGwgWdR2zAlCCjF/I7HgzQexxjxodmmzaf9XZzydqtovt qlkYb3jcdy3vzWx68mvG4YXap7jTpePKRCbibnh9CXmg3K8XBeHwjwhNApZ4lVsC75rb LLbFPN7HuvR8eRFrCMyruX+pxbPx6Pwz6mjZSUUyM1WeHQ6al71mY2RbUaBrd9jekoq1 j4fbwx060qDXHggDLBuZxoNqesdYDQYp9GkOG4/vb0HFb0FC/bpsL8B+EF02oP+Ax7a0 fyM20uBsn9hA8GnVRo8n+k43N460MlyCjtWoExalotGlWDt7X8Qojh9PEoMDrBK4wFCW kuPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=L/OioBrAnE72vE7NNKjJat9jlRhf3Pd5b76Z1cXoMBs=; b=0j4p4DZK6RNW0v75bwfkvL513kYTS+V2D7KoIk2LJ+eEJZAvnfyRN1fh5shjoEZHpr R8AqtEFOLZoi1CUJfdYwa2A8korXcvJWVYd0d1qA5mwm3ZjAMchT7itTbVAtivwu8B8Z +H2C30lUEu9Z3E/sSVqe2g+5tzRnacNPseG7aTTEbsaUNieNqpDStQVUlIbb8XximpFp 9PsYDYlSHpRqd4H0JSsHVlAZWeTZ26ke8VpIRphWvACeHNwgkADhfAvkm13Eh0/JorIO szGB7w8UQBw83pbpmnWzbDkcms7yBMUSYydTEM4kdgYu+90Jof6o+yQiYyGQBOETW1HG 8xtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=AqOnIz+J; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lf11si3434036ejb.48.2020.10.01.07.25.15; Thu, 01 Oct 2020 07:25:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=AqOnIz+J; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732349AbgJAOXn (ORCPT + 99 others); Thu, 1 Oct 2020 10:23:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732096AbgJAOXm (ORCPT ); Thu, 1 Oct 2020 10:23:42 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 92853C0613D0 for ; Thu, 1 Oct 2020 07:23:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=L/OioBrAnE72vE7NNKjJat9jlRhf3Pd5b76Z1cXoMBs=; b=AqOnIz+JxjKzA9r3V819wAxu2G cWLI7tWRyoRsBvEit7CQ8Uck/XifqK/6Swk30G1KVDOrzdprvWLvvdvPDqvzQLOEFcQqI0Gw4UmXN enJEZXmLbUDxzkJRP/Q1y4gvps4RvDj8SAtR3CbRDc0T3JOODufkrGfW8dOJBBhktKs6KQhpAXlCt 3wMSVYXmWOx3Qi+HqFhxXvQ1knW96Jmk8Gl4dol32iOUksDXZLGE7gttV+w3346yBlYrMooX3sPLu 0xqV4m/nqnlPpKMlcqLzEDRpTFbeL2t7ynvK4qTMYS4gmoA0xTi3JLfVG6RJzVyY0O/+LQ57vMwwi II3MppYg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1kNzUF-0008KO-PW; Thu, 01 Oct 2020 14:23:12 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 6B1C6300446; Thu, 1 Oct 2020 16:23:08 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 56CB02038FB7D; Thu, 1 Oct 2020 16:23:08 +0200 (CEST) Date: Thu, 1 Oct 2020 16:23:08 +0200 From: Peter Zijlstra To: Dave Hansen Cc: "Liang, Kan" , Stephane Eranian , Ingo Molnar , Arnaldo Carvalho de Melo , LKML , Mark Rutland , Alexander Shishkin , Jiri Olsa , Andi Kleen , kirill.shutemov@linux.intel.com, Michael Ellerman , benh@kernel.crashing.org, Paul Mackerras , Andy Lutomirski Subject: Re: [PATCH V8 1/4] perf/core: Add PERF_SAMPLE_DATA_PAGE_SIZE Message-ID: <20201001142308.GR2628@hirez.programming.kicks-ass.net> References: <20200921152653.3924-1-kan.liang@linux.intel.com> <20200921152653.3924-2-kan.liang@linux.intel.com> <4e974520-6d0f-68af-7eb8-fa52d95ba77b@linux.intel.com> <35e875ba-2c04-8452-5105-ccacf72840d8@intel.com> <20200930173042.GD2628@hirez.programming.kicks-ass.net> <641fa138-23b7-8fdd-27f9-87e2fdd9fa91@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <641fa138-23b7-8fdd-27f9-87e2fdd9fa91@intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 01, 2020 at 06:49:36AM -0700, Dave Hansen wrote: > On 9/30/20 10:30 AM, Peter Zijlstra wrote: > > In general though; I think using ->active_mm is a mistake though. That > > code should be doing something like: > > > > > > mm = current->mm; > > if (!mm) > > mm = &init_mm; > > > > I was hoping that using ->active_mm would give us the *actual* copy of > the page tables that's loaded in CR3 for kernel thraeds. But, there are > few if any practical advantages of doing that at the moment. Some of us hate active_mm with a passion and want to remove it entirely (/me waves at amluto). Also, if !current->mm, it had better not be accessing anything outside of the kernel map, so &init_mm should cover that just fine. And given the kernel maps are shared between all CR3s, they'll see the exact same pagetables.