Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp4737439pxk; Wed, 30 Sep 2020 10:20:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxYXph2RurbWfyvuznDwY7BK/ZZLSVTi5A4FbzPuy1Nzp/kF/lNrdmI0hgVzKoOLww6EBVJ X-Received: by 2002:a17:906:a156:: with SMTP id bu22mr4064423ejb.177.1601486407472; Wed, 30 Sep 2020 10:20:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601486407; cv=none; d=google.com; s=arc-20160816; b=VCU7ezibZRwor5xLtky3ywzNikVp127QO3mSaLSm4Ql/rKg5F6EAQ+8vgIuGPBaL+o CKOW1rRDVvf80NBh84rE7qKUYRBkmNTcprCRyTu04PbO1eqjTWGsM3absMXwM3L/TF9k Gf3I2l1qQItKejXUe077BQPWIH3UQ18HbBJFQhTmM8j1jGLiw3hWtIg1BCQ/ldsbmsei D2ORh04qOwBDUAzGSS4jJGxOISbN77phZ3b4Sr5DTpNoieP/Sfdp4FyG66gStavHJbXG HeahFl1MobHCa5aHljKO7ArP/HX3RmY9sR5RYyW9Dsj/+b/I7U7G8SSSwxPjwlAXJfRE yRKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=pI0ZPii+Ef4ldfhEFgHhgreWPVL6YgxnLxQdaEvG2Ik=; b=CfMXQ6mWH5u6tKiUHcrMuuK1QCVWS64VnXI+cGkKepWCpQ2Apa50VPBrhnwgfxGlFC c2lPWNjvu6TGx2OndyYjWRnzSr36Z5wfMgSJOo/yKhap9P+tCC0jGwPAhOMC8Tk0ablE xSM1O3waz1PehT+2HpvETEGUq/LA+LnC2VcTANaGabO7/ukvaPC43+A+BSi24vfvlFzO +8AF0xp+f52FDKwECpZptJMT9CsIscITNghb5qCrtUuXI3XYTmi0HJc2oda0YqlLkMpA gaO1RaT1begrgkrEY+Ec/Lw+sewdv4VDcc5swdBPsQgjNv9gwyjX6Sv8istHb0LvLf82 174w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=isfEgguR; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n25si1440699edq.555.2020.09.30.10.19.45; Wed, 30 Sep 2020 10:20:07 -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=@google.com header.s=20161025 header.b=isfEgguR; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730893AbgI3RRx (ORCPT + 99 others); Wed, 30 Sep 2020 13:17:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59214 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726476AbgI3RRx (ORCPT ); Wed, 30 Sep 2020 13:17:53 -0400 Received: from mail-yb1-xb43.google.com (mail-yb1-xb43.google.com [IPv6:2607:f8b0:4864:20::b43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E795C061755 for ; Wed, 30 Sep 2020 10:17:53 -0700 (PDT) Received: by mail-yb1-xb43.google.com with SMTP id k18so1862455ybh.1 for ; Wed, 30 Sep 2020 10:17:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=pI0ZPii+Ef4ldfhEFgHhgreWPVL6YgxnLxQdaEvG2Ik=; b=isfEgguRV45OV/H+5M2SDAvctmMWraDuCzYsMoO8ze1Td/qY/F+uDZSU0nJtauFyjN otE+4YWFK4aHexsMLaipZFG7o4e0i5B06ejpd8HcEobH7VHAZNEuAfQD1cs58vT8ApFN UCbRbnxnLy4sy483yEjRbrXSQKNeXSEyGQWe/LgAcokEYE2qvvn6VSIs8MLO9rKTPuTZ NVGWUJ7DxqOTTx8ZMnM2Y0n/AKQFeoDofLQiokQyrqPlCCCsCmI+IEX4kiY2z6DtYQcH bwLm92Tx8blyaNDjkR8Sc4D5EyN5JtQFsUsBG7QtFcdWQDD51Ywyd+mbzZdUug3Krtd8 gkFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=pI0ZPii+Ef4ldfhEFgHhgreWPVL6YgxnLxQdaEvG2Ik=; b=tv7lZ8J+HVxUQWHmwbwn2W5/VBuZvf2n5zK0LhN/vR+m0PHZlFO2jsHBtn7mcViIsd Hd9e8VoVHb5ilbUpenGEHsjzpn1JX4dbv41txOfkbuiXEMxNIfK7mwXMkgV8Bw3pwKn+ SO84Hs3JPOQAZFPH339nUTB9KRxOo60aOn9REbTSisL3zmi4Wynp2uATDTOf+Lz6bI3x kjfDhqEYAgpjRVwITqs/eoi/oViG857sLbidjQWcOBlT8D7j1qIbKScTh8iq/6aWlK/C RhXptyVZLUclasC8UuB5gd4BKK+IF9+gdagvzhxZgd27PYNG5oA8HjrrjgZlr3x+9crt 0BzQ== X-Gm-Message-State: AOAM530Hlw+25RkGEJErJE8D5jOD1Q9U/bRa5ZzyjK1ewSQjUlk24alp WL3KmCfawrpJKhT+vJHzorB9Lte/gZ724NCUw26UUA== X-Received: by 2002:a25:bd93:: with SMTP id f19mr4130854ybh.155.1601486272356; Wed, 30 Sep 2020 10:17:52 -0700 (PDT) MIME-Version: 1.0 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> In-Reply-To: <35e875ba-2c04-8452-5105-ccacf72840d8@intel.com> From: Stephane Eranian Date: Wed, 30 Sep 2020 10:17:41 -0700 Message-ID: Subject: Re: [PATCH V8 1/4] perf/core: Add PERF_SAMPLE_DATA_PAGE_SIZE To: Dave Hansen Cc: "Liang, Kan" , Peter Zijlstra , 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 Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 30, 2020 at 7:48 AM Dave Hansen wrote: > > On 9/30/20 7:42 AM, Liang, Kan wrote: > >> When I tested on my kernel, it panicked because I suspect > >> current->active_mm could be NULL. Adding a check for NULL avoided the > >> problem. But I suspect this is not the correct solution. > > > > I guess the NULL active_mm should be a rare case. If so, I think it's > > not bad to add a check and return 0 page size. > > I think it would be best to understand why ->active_mm is NULL instead > of just papering over the problem. If it is papered over, and this is > common, you might end up effectively turning off your shiny new feature > inadvertently. I tried that on a backport of the patch to an older kernel. Maybe the behavior of active_mm has change compared to tip.git. I will try again with tip.git.