Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp3530542rdh; Thu, 28 Sep 2023 14:44:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG2+KhWy5d+5sCDgBQNp7uvYLbPlrfl80iS++iouWVLyLC4oP1X7kfXsSWTnTHvVK4wATE6 X-Received: by 2002:a05:6358:2825:b0:14c:4f02:f3e with SMTP id k37-20020a056358282500b0014c4f020f3emr2881483rwb.21.1695937492589; Thu, 28 Sep 2023 14:44:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695937492; cv=none; d=google.com; s=arc-20160816; b=qlsd4YzrVrDXuvziz51TopPKemaMPfBC4pLI2LF5Q95EZb9PO6F6YEJLSPlmLkba0+ K1hmAl3/vk0+Cb5SuL6r46lrpvrNLbwYxFUKR3RxXURnDa70eFIYjDpzIYG2pIc+ADEX NLRKh2GKP79D4ggkQonTrKzBFTD9qVFoEb4HzU7Oie9kVf3VlCfFXP8xYfib55GvUeSt krHKYsvKGNSJ63W6L38wtM+ZxKS0hVfzgAsuQfjYMCkxDEXs1q05vHsKDvvLDjSdTRoN AS+AQLw7MCgd5DhOEfjEcdR4mvFyf0djO1mQrjGSElXLITDqTh+/9vZIfOswgSM2pM06 VUkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:references:in-reply-to:subject:cc:to:dkim-signature :dkim-signature:from; bh=jGjepNcDQZMCY4f7saBj8ug9eG8q1NjucB0xcANdtdw=; fh=TJYsW1sIWkN+0kK5y9QiNxfFWQcXzn0LdBp4GtsSjfU=; b=XTDNfHOn31gpK+IL1IaqvK6ClcBDlv6NTePEgfJzoJj2rbPWSE/u53C9bAlcRB66w7 ox6CwIgxCrlwJRe2yPBt+pvqim8AADdCAwdBTrSBVyHZliDp5fuqpEB39yHUQIehMRSj RL0ApOgxegE6ZIIGpOlCOxiyzgVXlihx4Z6HbKaKZ1e/SKoAz9JvzJOtodastR+ZJPfG l4f5GjJ0RnTrW6LxieVpBDMjtaGSGH+AcQoPLdRO1mJE7rtVrvir9dMZks/RXKJKjykO cSn3DvDr282Mp+Dbl1RKYuMDthxwg1GhxtFMXdBkzQynl9L3pvy7/P5nDDomSPdsZdav VVJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=UjCkVUuk; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id s140-20020a632c92000000b00578a56a39dbsi19995249pgs.409.2023.09.28.14.44.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 14:44:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=UjCkVUuk; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 0161C81AAE40; Thu, 28 Sep 2023 14:44:50 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232313AbjI1Vom (ORCPT + 99 others); Thu, 28 Sep 2023 17:44:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50664 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230325AbjI1Vol (ORCPT ); Thu, 28 Sep 2023 17:44:41 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD7ED19D for ; Thu, 28 Sep 2023 14:44:37 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1695937476; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jGjepNcDQZMCY4f7saBj8ug9eG8q1NjucB0xcANdtdw=; b=UjCkVUuksRe89PS9UoXkC/hMfxp9JIrk3Amcnpzo7p5m/iS7rYEvxIrkm4DZpT5Qydq8In WsVAGdIJaYRcfi+q4CfDY8m4pB1v5aOFqo1ijSRsgLKA5/fUNGwofDjmLq3PoGAvnE1UlD G2wn+XSM5ReWhnoJ6+EphV8W4NmLp15rVXZIARFPGgO/Vs+Du9mcGN98nZ12b8pwkrKIbo r9Jhgu8f+5BCel1CLsB5iGVkye1n8+4qJXLNNarSYr0x7UmLMRaJV4OY8tZ3Lhx1xNQ8aB CiIoJxs/Axjftwjdx84ZAiDGjBl1BjXPF0nQmDdCK38/MNEmXwDTOv81kTlcUw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1695937476; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jGjepNcDQZMCY4f7saBj8ug9eG8q1NjucB0xcANdtdw=; b=2tiGWDP7CZydnFljXaVJKM7NWTHA4dAvaTN9YMJPLvcidp+8543NeoT6l9h5oTQXpd/M75 u2PD/bZ//ZHBgDAg== To: =?utf-8?B?TWljaGHFgiBDxYJhcGnFhHNraQ==?= , linux-kernel@vger.kernel.org Cc: John Stultz , Stephen Boyd , Vincenzo Frascino , Andy Lutomirski , Dmitry Safonov <0x7f454c46@gmail.com>, Andrei Vagin Subject: Re: Loosening time namespace restrictions In-Reply-To: References: Date: Thu, 28 Sep 2023 23:44:35 +0200 Message-ID: <87lecqdlbw.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Thu, 28 Sep 2023 14:44:50 -0700 (PDT) On Thu, Sep 21 2023 at 18:39, Micha=C5=82 C=C5=82api=C5=84ski wrote: > I faced a problem with the current implementation of time ns while > using it for container migration. I'd like users of CLOCK_MONOTONIC to > notice as small of a jump as possible in the clock after migration, > since according to the documentation "this clock does not count time > that the system is suspended". In that case the formula for clock > monotonic offset is "m1_monotonic - m2_monotonic - migration_downtime" > where m_monotonic is clock monotonic value on the n-th machine. > Unfortunately due to time ns restrictions, I have to set the offsets > before putting any process in the namespace. I also can't move > multithreaded processes between namespaces. So I would have to know > the migration downtime before the migration is close to done, which > seems impossible. For that reason I'd like to drop the requirement of > having to set the offsets before putting any processes in the > namespace. What do you think? Is it possible to implement this and get > it merged or should I forgo it? If you think it's possible, I'd > appreciate any pointers on how to get this done (or how to solve my > problem in another way). Lots of word salad. Seems your newline key has an issue. Let me split that up for you. > I faced a problem with the current implementation of time ns while > using it for container migration. > > I'd like users of CLOCK_MONOTONIC to notice as small of a jump as > possible in the clock after migration, since according to the > documentation "this clock does not count time that the system is > suspended". "I'd like" is not a technical term and the documentation reference to what clock MONOTONIC represents does not help either. > In that case the formula for clock monotonic offset is "m1_monotonic - > m2_monotonic - migration_downtime" where m_monotonic is clock > monotonic value on the n-th machine. I which case?=20 > Unfortunately due to time ns restrictions, I have to set the offsets > before putting any process in the namespace. That's obvious because how would you guarantee that the process cannot observe the wrong time or does not expire timers early? > I also can't move multithreaded processes between namespaces. I have no idea what you are trying to tell me here. 1) What has this to do with multi-threading? Are you suggesting that having thread A of a process to be in a different time domain than thread B of a process is something useful? Seriously this does not make any sense at all and if you think that's something useful then you completely failed to explain the use case. =20 2) How does moving a process from a time namespace A to a time namespace B make sense at all? That's simply impossible unless time namespace A and time namespace B are identical. Otherwise you screw up time readouts and armed timers in one go. If they are identical then there is no point to move it, right? Aside of that you fail again to describe which problem you are trying to solve. > So I would have to know the migration downtime before the migration is > close to done, which seems impossible. For that reason I'd like to > drop the requirement of having to set the offsets before putting any > processes in the namespace. How do you guarantee that the process cannot observe time going backwards and timers firing early when you set the offset after you restored the process into the time name space and resumed it? The answer is: Not at all.=20 > What do you think? Is it possible to implement this and get it merged > or should I forgo it? If you think it's possible, I'd appreciate any > pointers on how to get this done (or how to solve my problem in > another way). I still have not figured out which problem you are trying to solve, so giving advice would involve crystal balls. I misplaced mine and even if I could find it again I'd refuse to use it for giving techical advice. Thanks, tglx