From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BC19B3E0259 for ; Mon, 25 May 2026 08:37:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779698265; cv=none; b=q+Aw5YGJ2Q5YPMnahQaWXhPRB4ptQNl7WpvELepJysMIsR7HjvcnB/ZPcX7KQTlmira9qKQIS7/wTVH2ZodneIjNsInBklIdtOoXrYMhq9yUvPAarMZ7mWT5Zxos9oBdtolSRdoHo1Sa0Ah9TBSgjIqNub3gzWPgPVwiZMs1tys= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779698265; c=relaxed/simple; bh=cp1mL1dIhkUvB6+xILSNG9fwFwaN/cKYTi/pHDQxij0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=uFxmapClNJjUSo3wxUODl2/pb0vLDB6AlXyqwlak7ZS4pKTDmTHf8iAa+Lqs3xujB3SCiaaAdkM80eWU3o/+x1fnWODSucstXz/Ts+zuR/Jhj+et22BuubBtcJ+AJvCq8zJ9jxx5Unjvt7lQDhCoau++WPfrXwrSiuxZf5ZXi9g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=IXceZbLy; arc=none smtp.client-ip=209.85.221.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="IXceZbLy" Received: by mail-wr1-f44.google.com with SMTP id ffacd0b85a97d-452169ae568so5991716f8f.3 for ; Mon, 25 May 2026 01:37:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1779698262; x=1780303062; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=wrvzffc0UsXL7qKuTM7JSltXtAuv/Xsm3qLeE4JOM/s=; b=IXceZbLy0hvPVgGFKuWDCUCWu5ZnpyBd6p6LycrTtjmYpiIBsXilcgBtwhi3dusPUa 7LyCugN+0gyyZLsWKelHBAfm3iaFVOTHOUf3GcP5NmEAJuRK9PSuYrxPqN1YGjWFZS0U xslDLv5odKre+tp5/XZ1T0GPsBTGo62KYf5Nqy33mBzY/BMiM9fU35hgAfMdmSxM7pyV gx9zrjCsLod5VncOUfgIg3lDQaC4ZBEN1s2YitR3QkZQHxXJaQr6yZi5H2d2et5w9pPw kKsCGUujVKmFZTIPT9FXCNl7YzLOERd2kNzkewdKHJjV6wyLau8bOHWtpxGwRj2PBtnM 9Omg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779698262; x=1780303062; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=wrvzffc0UsXL7qKuTM7JSltXtAuv/Xsm3qLeE4JOM/s=; b=jNGwByD6lDgtb48xYSUW5Q9VR+7Ljc0kabNQ7YoNMkCaaRtNn9rBigiMx44RCjuW72 ftYipqPjHjcdMpu9ZuNzVyHbtOh0mHiam7l2hTKHWNsoXUyATbxVgj8ySWIRD0QvWtt2 PY9LjjSJR0MZpb1hOmvvFh0GK8XTKBwuCxAGmglaUMdZRQsnUZsJ+FazuVOUP74X7lni zCPFoqaCjoOTTVHtrZ2IClNXVsKXyRk5DAJibF+g36p2olB+0waKOxlsQIW9kFo2WRUS AQIDWOLkFkKpAQ8ogvUNftyXqBvTjgeoJqBUp/IZJmW53L5Br/fMgAf7xMirem0KLyqW 9pBQ== X-Forwarded-Encrypted: i=1; AFNElJ8UM/GtgQaie6qywCMMm8dB8nWb6Jtezth/4Cs57I0XextmkQErzc3hHlVsWzVkK3irMpt8oeObB0n8tgI=@vger.kernel.org X-Gm-Message-State: AOJu0YygvZS2tgPvpid/lA0gUs3urd3eGTbowjLXuYinJCWVkVodEYoF 7zjIyFKu9hi707/1R0ou1hPZe8eijSL6hkRiH7lV9Q3ioTZg2RtFn3s6aUTgHygJRjE= X-Gm-Gg: Acq92OHgrckLhwrnPs10w+4qNANQWg17GSXqRdSyqVYkHNLkikDf0fSxtggWm2cGEI+ VcbKTIWjS+sq87lF0phG4BOSmCZBQ0et17SEjDozKZGG4zrwyF6gYjJF60JfVWv+Pdlu97GrRli t/QdWfz7ySPpTkWtpA1adXpL9qYyeKYSJLyMOXZIQ0trnHzz6hhxWgdXegIs0YjaLODwb87aULb lHXFNJ5efGysLVt8NtSvqtKoO+LLA9OLMUbImxNLbw1bZ2GcUCs1737+tKz9/KLAZkPJSWA19ap 7e3LbnsIz9B2qD9oc3kVwapPmdEWyHrSKROuE4UCjwssgHW35hT2s5MlqR350VaoFJW6FQ1nEzg pC2DqtkoU03YwYXzH2nwltAXJx314qz7JDg+h4HKCpXPeoIgsiuGZ+ca/u5wY03m2/hmxtZoIgy E62+DPzXjOGIiM+7nTSVHU8xtDSw== X-Received: by 2002:a05:6000:26c4:b0:44a:2555:f8a9 with SMTP id ffacd0b85a97d-45eb369072emr22021844f8f.10.1779698262088; Mon, 25 May 2026 01:37:42 -0700 (PDT) Received: from pathway.suse.cz ([176.114.240.130]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-45eb6d7167dsm25534399f8f.35.2026.05.25.01.37.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 May 2026 01:37:41 -0700 (PDT) Date: Mon, 25 May 2026 10:37:40 +0200 From: Petr Mladek To: Thomas =?iso-8859-1?Q?Wei=DFschuh?= Cc: Steven Rostedt , John Ogness , Sergey Senozhatsky , linux-kernel@vger.kernel.org Subject: Re: [QUESTION] printk: time namespaces and printk timestamps Message-ID: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Sat 2026-05-23 17:20:45, Thomas Weißschuh wrote: > Hi everyone, > > It looks like the monotonic timestamps of printk records do not take the > callers time namespace into account when emitted through /dev/kmsg, > /proc/kmsg and syslog(2). > > To me this looks like a bug. What do you think? Should it be changed? To be honest, I have never heard about time namespaces before ;-) So, you propose to use the timestamp with the namespace-specific offset when a message is added from the given namespace, e.g. via: echo "This message is from another time space" > /dev/kmsg Do I get it correctly? I see two potential problems: 1. printk() historically used a monotonic clock. I am not sure if any usespace application depends on it but there is a risk of breaking something. Anyway, the printk messages are used to debug kernel problems. And the order of events might be important. IMHO, messages with random offsets might create confusion. 2. printk() has to work in any context, including NMI. It requires a lockless way to get the timestamps. I am not sure if the namespace timestamps might be read a lockless way and if it would be worth the effort. Best Regards, Petr