Received: by 10.223.164.202 with SMTP id h10csp195660wrb; Tue, 14 Nov 2017 13:33:45 -0800 (PST) X-Google-Smtp-Source: AGs4zMbA2MvCZquWPxdVu05yyL4Rs8p1iJBxl6F5Cj58VZlDsNbI96E+CceBkwAMRtPFX3TqYn39 X-Received: by 10.84.211.105 with SMTP id b96mr13155181pli.86.1510695225503; Tue, 14 Nov 2017 13:33:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510695225; cv=none; d=google.com; s=arc-20160816; b=anOTvk2Xtp7SDGn2MlDcV4E+urppyz985+htr5IXXebwGHXMGODpJJzThyNwFSuYFp gFhuFwRvuJ+52/TKs/mNOf7I+83poIzJ2RadYPDBYEz6skrO6p++FJdHDIe3rqG5zia3 a4Bwt6sDmcrJI77RLl+BI0PGlDJx0pIlavDI80jy1bx8p+Bmp6JGWMiOgsgZ3HPv5cIK NHlxr2e6aoSYM7RIgcRZDm2FkSINwJv2R+Olr604EL1TjY2S271tu7+y2H0+Q57UTw+W 4u+p6JIq2oSlNEXi6+4Z9wGQxoIAAxr1f/pLoG46xBwg+JUYEB+PEfqi4zHDE3qPwqTm onlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=fw9faq+H+qIRM7br+lYfjGbxoH4yZPbV0hXNnd4SqBU=; b=ymEZNlJQRGFc9QgQkGcHL3jDAtMp2GMdyr3xZgMNHDlUYWD3VV3L3xiz0rRpm0Fmlj ysJkSxzakwlaP/EpEabnrEKtWEie+lptdqQxfW22AhUX16v9Un8OXWQaVPvq9j50kddu imPNq0Z9MBCY7eSMGYjf/yy8/763KcSXZpahLMCt8Co8GzC2qo2Xgn7nJHvkUSK8rwH/ MkLSa+pfpQ5vMUriFXHhZR9jB+cCayIrMzcJesFx/JoNp4WMLDfSIIHEVOKiYzp24R+M wt2Wv4IpFNMAhn7AMICxPdACfARnyOI5AwTxzExgWGoSX1o0ZZ+agtXUL4IxeC2UtRXg aI7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=j32EKa6x; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id w16si16960277plp.765.2017.11.14.13.33.32; Tue, 14 Nov 2017 13:33:45 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=j32EKa6x; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1755890AbdKNTKj (ORCPT + 88 others); Tue, 14 Nov 2017 14:10:39 -0500 Received: from mail-pg0-f65.google.com ([74.125.83.65]:50872 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754251AbdKNTKd (ORCPT ); Tue, 14 Nov 2017 14:10:33 -0500 Received: by mail-pg0-f65.google.com with SMTP id u3so927673pgn.7 for ; Tue, 14 Nov 2017 11:10:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=fw9faq+H+qIRM7br+lYfjGbxoH4yZPbV0hXNnd4SqBU=; b=j32EKa6x+Ip/rJ5bWmjXLygO3Xo6eXu3O7Jj4TX9WsemZZnNu0YmlWWDbkEe24esCk qnRpIu8qvQ/ffCXWCB+ou1LCu215eGZ71wXyqfbvL1so6vfbixhVvZuJR5k8o3d6NURv UT/91J7aGKiC6843xtNF/nGL94hqFtyNjELeycpjdVZBKRL17x530k6I+tgMz0bQYLwg DvqI2kc8zKKWj/5bi8X30BKVjuNqRzj646hxf8Nb4E5xY1ZtLJvXgatr8QKU+1ZYERsq 9CNwS18LmD+tfEcP3KW19tGIaFjxGTcnu+OtesKJm3xwkvP0L+jDVZBugYl6aKAt/cxT y5Rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=fw9faq+H+qIRM7br+lYfjGbxoH4yZPbV0hXNnd4SqBU=; b=Tua1QvCrjJLTswZAY8Ebw67URJ6ZinY++LEmd3t3K88cfMdXN+Ofcq9kgzNReW6VNa LGQ4BhB2c58wYZGbxZeqVLhGpOVy7+RBxxYl7fZgUMo7NlGVVmd7oVGgY4h4QOGVe7mr Qzj0IYHtyCmtVXv6iZCmJyvUWHAjrQC5nW+ICe1OekdcD/BrKrOsWIV+5fxIz6by7ie2 lQgH/09ejI35aZLmme9BVUiPbdkAO0EFl8cgZiVtZ/N2iPm+zJVW/rrcGiqrS3Lh1JMK P8ONirXdGxXLRmMrDDOIjN2bvehdfaxJOP0DOeneBz7kKyCtKsoHCdzea5x8VLsENSc9 sS4A== X-Gm-Message-State: AJaThX4FUmxgECQwqVIna7cfq/6mc/yZZSqwijOYTDTDxFO+mq1XNjZa XejLVHkBSnKzz1NgJ+benlyc2g== X-Received: by 10.99.152.25 with SMTP id q25mr12939295pgd.170.1510686632038; Tue, 14 Nov 2017 11:10:32 -0800 (PST) Received: from [100.112.93.27] ([104.133.9.107]) by smtp.gmail.com with ESMTPSA id z16sm5361046pge.62.2017.11.14.11.10.30 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 14 Nov 2017 11:10:31 -0800 (PST) Date: Tue, 14 Nov 2017 11:10:23 -0800 (PST) From: Hugh Dickins X-X-Sender: hugh@eggly.anvils To: Dave Hansen cc: Peter Zijlstra , linux-kernel@vger.kernel.org, linux-mm@kvack.org, hughd@google.com, moritz.lipp@iaik.tugraz.at, daniel.gruss@iaik.tugraz.at, michael.schwarz@iaik.tugraz.at, richard.fellner@student.tugraz.at, luto@kernel.org, torvalds@linux-foundation.org, keescook@google.com, x86@kernel.org Subject: Re: [PATCH 18/30] x86, kaiser: map virtually-addressed performance monitoring buffers In-Reply-To: <30655167-963f-09e3-f88f-600bb95407e8@linux.intel.com> Message-ID: References: <20171110193058.BECA7D88@viggo.jf.intel.com> <20171110193139.B039E97B@viggo.jf.intel.com> <20171114182009.jbhobwxlkfjb2t6i@hirez.programming.kicks-ass.net> <30655167-963f-09e3-f88f-600bb95407e8@linux.intel.com> User-Agent: Alpine 2.11 (LSU 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 14 Nov 2017, Dave Hansen wrote: > On 11/14/2017 10:20 AM, Peter Zijlstra wrote: > > On Fri, Nov 10, 2017 at 11:31:39AM -0800, Dave Hansen wrote: > >> static int alloc_ds_buffer(int cpu) > >> { > >> + struct debug_store *ds = per_cpu_ptr(&cpu_debug_store, cpu); > >> > >> + memset(ds, 0, sizeof(*ds)); > > Still wondering about that memset... Sorry, my attention is far away at the moment. > > My guess is that it was done to mirror the zeroing done by the original > kzalloc(). You guess right. > But, I think you're right that it's zero'd already by virtue > of being static: > > static > DEFINE_PER_CPU_SHARED_ALIGNED_USER_MAPPED(struct debug_store, > cpu_debug_store); > > I'll queue a cleanup, or update it if I re-post the set. I was about to agree, but now I'm not so sure. I don't know much about these PMC things, but at a glance it looks like what is reserved by x86_reserve_hardware() may later be released by x86_release_hardware(), and then later reserved again by x86_reserve_hardware(). And although the static per-cpu area would be zeroed the first time, the second time it will contain data left over from before, so really needs the memset? Hugh From 1584071608177087135@xxx Tue Nov 14 19:40:08 +0000 2017 X-GM-THRID: 1583708990616525039 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread