Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp1130104rdb; Fri, 9 Feb 2024 11:07:20 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUa5iNDWNMJMa0bjaVtAxWQF02wUxN/RBFS9T9r+tzy+JJgRYU1ICmmZbJ7dJydhWkTl/LnqARWYr3ZsHyBmbIy2Zl9Rms0/H7PipXgzg== X-Google-Smtp-Source: AGHT+IFZEoak/dO9xXbKF9KHleVmU7QpmsbErAIM7c4mcB3uUxBHea+IE2CSm0UQVJDIu3ccvIIw X-Received: by 2002:a05:6a21:8ccc:b0:19e:9af8:40e3 with SMTP id ta12-20020a056a218ccc00b0019e9af840e3mr41566pzb.16.1707505639879; Fri, 09 Feb 2024 11:07:19 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707505639; cv=pass; d=google.com; s=arc-20160816; b=RDaBuzorP/cL7WaiDmeKtXLSUfuAOlDYeQJZH71J1qHuWGe5eYNIsA9obfhCKnGdHt xWNpPsqQhihwsesTBCQ3Dch34SeSYZG5UCZVjgrLTRw6XNGDDNwLaCRUuoP+HMJTX9nc 5EuSb3/lFjtcqAo4nId18Pdcb34HPojp6gBBVxCcBxHmZjCBo9jAlvpmrrvMs1y4pfnf m7x3b4YNGhn3vBig0pgNW0RVgtPtAqjfMpLvaShShudOAGb+kkkwLf5Hf5r2UMhV41+4 5NYFwFQC4QhN+/UV/TS1YMqAkPaxxaIayqGmjMADywje0GJElcRwRnr+hdpolJTZqLxy TTBw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:subject:cc:to:from:content-language :user-agent:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:date:message-id:dkim-signature; bh=OZ9DP+YpmV3l/RQl/5riktXTUKec9XS6ZdimkFH30CM=; fh=GqHrnJuOgFL2oilQyzvFE3Of9Tpqn+Nae3QjEswIN+U=; b=hIo4Jg8LbB0zDORYCyYizPWoyGFp0Y0c9oTMDKXIFgo1JLdIyd76jHg8M1/aVym7cg ioKdTIhulq/Pm3S3UxamGhQsIjeITa8aJlwrwU8xrHxA9RfkQY7ZN5tFxiQxihRmIWBZ y12l+VCj275RvUNrfdvmLPjWeBrQP+Fd/NY/W9rjJMx1Z8+ICK1WJVF2IGGDGgO9BV0P p0ShkxHsByZNE3ycT+02ljq/HoRnQe/uwxXOazLr0AS2NkWWvJg2xcZNEBov7NzyxfL3 91V1nzS7meqjXfxNrmgTaSVGWfQKDkNIFaZy9C/F15C7gpnuMbUUJCkO6NPOrv8GoNg/ Uk8A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@efficios.com header.s=smtpout1 header.b=n2SyNqDX; arc=pass (i=1 spf=pass spfdomain=efficios.com dkim=pass dkdomain=efficios.com dmarc=pass fromdomain=efficios.com); spf=pass (google.com: domain of linux-kernel+bounces-59856-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59856-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=efficios.com X-Forwarded-Encrypted: i=2; AJvYcCWWKsfGRVc2vHtcbjoOLHfRi0LDr0NX5m9nol3tHJjy2inrAchUytB4OLM8fwmi9xPknCXrlqRcGf0VumD13KXxudBtK5SVscpvK5Jvpw== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id k6-20020a63ba06000000b005cfbea76cf8si2155970pgf.42.2024.02.09.11.07.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 11:07:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-59856-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@efficios.com header.s=smtpout1 header.b=n2SyNqDX; arc=pass (i=1 spf=pass spfdomain=efficios.com dkim=pass dkdomain=efficios.com dmarc=pass fromdomain=efficios.com); spf=pass (google.com: domain of linux-kernel+bounces-59856-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59856-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=efficios.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 1514728485A for ; Fri, 9 Feb 2024 19:05:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8CD0582867; Fri, 9 Feb 2024 19:05:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=efficios.com header.i=@efficios.com header.b="n2SyNqDX" Received: from smtpout.efficios.com (smtpout.efficios.com [167.114.26.122]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D6BB26BB22; Fri, 9 Feb 2024 19:05:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=167.114.26.122 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707505530; cv=none; b=q4R7nAR5OQLHQE9epsT8wO7tyYUti8PoQCXNKwsBhDxhIcJ1kHKMsRWEdF+aFz6pf6hGuyPDw58UDoMckqjxv3J+xyBJW1LXs87qyyty7V5jRd0J/yGrh5ZTqdrn7UbcpnoneN/R+9ibUZQ2z+Yj9SX1JRKuGWveZGfdx0VetyY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707505530; c=relaxed/simple; bh=gtanvazOXfKpj3BBmgPOI/S0uf7b9dENbOxl62Yp3I8=; h=Message-ID:Date:MIME-Version:From:To:Cc:Subject:Content-Type; b=DMaUY4bhGVNYb181khvomxu2MDXoW+xuf0cy1YkFvdREJOJREpd5l9PLgDed5MBJ+NgCgTtI7EdRaTjsVOqgc5NXUMYwO3tRLTLgCFP2g+Mjld17/n1hTMZhlJSvH8no4MgzNq/AIbq3uQwYfWiwgQBrjxo4dHNYskuguYNSDRU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=efficios.com; spf=pass smtp.mailfrom=efficios.com; dkim=pass (2048-bit key) header.d=efficios.com header.i=@efficios.com header.b=n2SyNqDX; arc=none smtp.client-ip=167.114.26.122 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=efficios.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=efficios.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=efficios.com; s=smtpout1; t=1707505522; bh=gtanvazOXfKpj3BBmgPOI/S0uf7b9dENbOxl62Yp3I8=; h=Date:From:To:Cc:Subject:From; b=n2SyNqDXxuu47KZyUbQ7p91xeI8YLt7VpFFF0iA8OdQzgi0qdbw2cxz7u0ksYvTUU ws5A3f5Vwxm5Fkedr9xszP8W2kqYDH/H4HuHln2f1Cr/ONKYwBbtmPN7y8aYvLDONJ OQygtkht344QrXCLqsS3MUXra4wqwuWHSRL45mYMr6+uZaXQhjEROaCv/GsIGft8bl JrRBIEG4Te+PhUzJJQKp8FFsO2kviupQv1D6ZYmUIn2zMtg5WSxXqnYt4ewyrMzAWC SfcqPvg94fDY/y0Oo9uoHaW/tA/GicfbBSntHevwu6apvO0fYZYkGwjgA7mqyBvSRR HoNi83hkwlG6A== Received: from [172.16.0.134] (192-222-143-198.qc.cable.ebox.net [192.222.143.198]) by smtpout.efficios.com (Postfix) with ESMTPSA id 4TWjwf1tpxzY0y; Fri, 9 Feb 2024 14:05:22 -0500 (EST) Message-ID: Date: Fri, 9 Feb 2024 14:05:28 -0500 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US From: Mathieu Desnoyers To: Dan Williams Cc: linux-kernel , Dave Hansen , linux-cxl@vger.kernel.org, nvdimm@lists.linux.dev, Vishal Verma , Dave Jiang , rostedt , "Masami Hiramatsu (Google)" Subject: CPU data cache across reboot/kexec for pmem/dax devices Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi Dan, In the context of extracting user-space trace data when the kernel crashes, the LTTng user-space tracer recommends using nvdimm/pmem to reserve an area of physical (volatile) RAM at boot (memmap=nn[KMG]!ss[KMG]), and use the resulting device to create/mount a dax-enabled fs (e.g. ext4). We then use this filesystem to mmap() the shared memory files for the tracer. I want to make sure that the very last events from the userspace tracer written to the memory mapped buffers (mmap()) by userspace are present after a warm-reboot (or kexec/kdump). Note that the LTTng user-space tracer (LTTng-UST) does *not* issue any clflush (or equivalent pmem_persist() from libpmem) for performance reasons: ring buffer data is usually overwritten many times before the system actually crashes, and the only thing we really need to make sure is that the cache lines are not invalidated without write back. So I understand that the main use-case for pmem is nvdimm, and that in order to guarantee persistence of the data on power off an explicit pmem_persist() is needed after each "transaction", but for the needs of tracing, is there some kind of architectural guarantee that the data present in the cpu data cache is not invalidated prior to write back in each of those scenarios ? - reboot with bios explicitly not clearing memory, - kexec/kdump. Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. https://www.efficios.com