Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp74550pxu; Tue, 13 Oct 2020 17:08:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwhk+b0veRyl0bBOm7g9JCfx/R0Iu2RG1n2cbsNeL4NDOWVxXyu8vyyXU4f9WQ/FbgZw1+x X-Received: by 2002:aa7:d4d8:: with SMTP id t24mr2344485edr.247.1602634117430; Tue, 13 Oct 2020 17:08:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602634117; cv=none; d=google.com; s=arc-20160816; b=YL7PN4RQLsFRM4JlwMvyOZPsKhtHCEkKxGYBWjWtMJxb2LL/Awf/944RIU0PETPkc/ qjEMUyJJWrvGVfQ6N0EZBI2jqDcSPaUcHFnweAERtbWCkqWJ3L0UP7rFhRiN8jxIQLiV MJejYd4ogDTK8+J0sMB9/2Wkb+tfBD/+ZhAiP0iOT6lLnPuRRq7Zef4WScZp/85OjI8W bn0nH1yFwjgTqadreD7aa7xVvjnxix9KJY8oSqJopr6LKDeOdusWliGp4el57qXXWG81 ya+LSJswmpz79sTrrPHtLQLzEyxWdnZtMnrJFWg7fb2w2CRtNPN4xqU1rp8bmhQO/whG UnhA== 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=e1ca2lcllPJTokKsEHB/HwifffWaWqHFIXBdwVUd9OQ=; b=Sr8viulMGt72oxZ3sttudSPSqW3StE6ju5azKPrRI5n3X/7mhkLmpCk1Ij5f/tHez/ iO/+mZrluOrTrgJy6HEyegMoIJ3xAlgJkg3+wu9NAfBiklIPNO/Ol4D6yMw91td3qFrI kUSKGpx2/q+YmHMDJGot3F76RDMy5cYT94uVtg28+YzDPC1+rF/+lm5n8CXpGGy4YRIa dhfNnN/zBNJJqpKi9VYKLpzTVQt+gQszhiMwk0oSNuo/EKXDvbrJcNMQomILrwdRq613 LxsXwFO7v9iSbKXTJwJ7VmojX0vpwB1q3Ewjlp6I6fiy6cGy0Vh7RfF3Q9H9fGXnIq1M BxHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=m9PnhgEj; 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 ov26si951915ejb.158.2020.10.13.17.08.13; Tue, 13 Oct 2020 17:08:37 -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=m9PnhgEj; 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 S1731212AbgJMPqs (ORCPT + 99 others); Tue, 13 Oct 2020 11:46:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727830AbgJMPqr (ORCPT ); Tue, 13 Oct 2020 11:46:47 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D80DC0613D0 for ; Tue, 13 Oct 2020 08:46:47 -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=e1ca2lcllPJTokKsEHB/HwifffWaWqHFIXBdwVUd9OQ=; b=m9PnhgEje+GEWn9NRUX0Y+dUue 7ZeBKMOfoMZ83ImDgHwPwtJx6Trepnwz/zzANyXXCUhHam8SqP4ItvpT6ebdgHXo0QP4W9TVPHd8z aIwE0ROfHSnQrcpSPngqqgOaPHaV6XNh5yW+jpNSCJP9shBFUQt2uvZFhpKec8S909p35xecAzJ8a YBmcww0UOXi9CvEJHe90wwQk+VPen8UV0HP1FGs8hTcJBFjUz6dBxjKRQSC4dy6mzRgxaOzrovX3e ct5pmSEMxKdauyalGM9aKvnssWha7UTPcaW8VGfgpefGJM7ELZroTxJq7a4kVpHji6QiNN2yfavqv vOF5KyTA==; 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 1kSMVG-0002Og-7H; Tue, 13 Oct 2020 15:46:18 +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 9007B304B90; Tue, 13 Oct 2020 17:46:15 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 446CC2BFFEB05; Tue, 13 Oct 2020 17:46:15 +0200 (CEST) Date: Tue, 13 Oct 2020 17:46:15 +0200 From: Peter Zijlstra To: "Liang, Kan" Cc: Will Deacon , Michael Ellerman , mingo@redhat.com, acme@kernel.org, linux-kernel@vger.kernel.org, mark.rutland@arm.com, alexander.shishkin@linux.intel.com, jolsa@redhat.com, eranian@google.com, ak@linux.intel.com, dave.hansen@intel.com, kirill.shutemov@linux.intel.com, benh@kernel.crashing.org, paulus@samba.org, David Miller Subject: Re: [PATCH V9 1/4] perf/core: Add PERF_SAMPLE_DATA_PAGE_SIZE Message-ID: <20201013154615.GE2594@hirez.programming.kicks-ass.net> References: <20201001135749.2804-1-kan.liang@linux.intel.com> <20201001135749.2804-2-kan.liang@linux.intel.com> <20201009090927.GQ2611@hirez.programming.kicks-ass.net> <877drz1qbc.fsf@mpe.ellerman.id.au> <20201012084829.GA1151@willie-the-truck> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 13, 2020 at 10:57:41AM -0400, Liang, Kan wrote: > > > On 10/12/2020 4:48 AM, Will Deacon wrote: > > On Sat, Oct 10, 2020 at 12:28:39AM +1100, Michael Ellerman wrote: > > > Peter Zijlstra writes: > > > > Patch 4 makes it all far worse by exposing it to pretty much everybody. > > > > > > > > Now, I think we can fix at least the user mappings with the below delta, > > > > but if archs are using non-page-table MMU sizes we'll need arch helpers. > > > > > > > > ARM64 is in that last boat. > > > > > > I think we probably need it to be weak so we can provide our own > > > version. > > > > I guess the same thing applies to us, but I can't really tell how accurate > > this stuff needs to be for userspace. If it's trying to use the page-table > > configuration to infer properties of the TLB, that's never going to be > > reliable because the TLB can choose both to split and coalesce entries > > as long as software can't tell. > > > > Hi Peter, > > It looks like everybody wants a __weak function. If so, I guess we should > drop the generic code in this patch. For X86, we have existing functions to > retrieve the page level and the page size. I think we don't need the generic > code either. > https://lkml.kernel.org/r/1549648509-12704-2-git-send-email-kan.liang@linux.intel.com/ > > Should I send a V10 patch to drop the generic code and implement an X86 > specific perf_get_page_size()? Will, Michael, and others can implement their > version later separately. Nah, that generic function, should work for 90% of all archs, it's just a few oddballs that need something else. Also, if we add that hugetlb exception, we'll even get the usermap for those oddballs right. I'll take this version after the merge window, I'll add __weak for the oddballs and also add the hugetlb userspace thing on top.