From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) (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 A231B3D904E for ; Wed, 6 May 2026 11:01:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778065318; cv=none; b=J3J9U/Oh0OC3LMDvzvVLHh2k+Ki3z42pJKnLDNuWDmvSOf6sMfbzZlP2ai6AETXjT1zVRkrGkmQn14QS8foAOHhEZhJ2y3DTov3daM0DPWkyNpLzF2izqFldJGUfO1AzsJI3cL0I49CtQRXdouZyA35/POf84z49JbXcNarbCro= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778065318; c=relaxed/simple; bh=QG1ZBdT0d6HLzdao1fVHLBJjJ9Pap8KH1rfe6FL1JJo=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=ZtuoAPTcebkmbjUS16JwRSE6itVDu+V3EpDJ5KwCsDUQCM9q0JVKjb1HU5Tvf7umBPu6CblmTsxISCd0iev+J761XWXVw3GGUhnbTrNY/KBxtBJ+ATa9RNYRL2y7sPKKni5BmGrzJAkLM7a4j0hyCWstu23/4oa5DubnHZSmItE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.dk; spf=pass smtp.mailfrom=kernel.dk; dkim=pass (2048-bit key) header.d=kernel-dk.20251104.gappssmtp.com header.i=@kernel-dk.20251104.gappssmtp.com header.b=dWhRfzn1; arc=none smtp.client-ip=209.85.221.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.dk Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kernel.dk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel-dk.20251104.gappssmtp.com header.i=@kernel-dk.20251104.gappssmtp.com header.b="dWhRfzn1" Received: by mail-wr1-f52.google.com with SMTP id ffacd0b85a97d-43d7badbd7dso2951042f8f.2 for ; Wed, 06 May 2026 04:01:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20251104.gappssmtp.com; s=20251104; t=1778065315; x=1778670115; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=trYLINoZQm/dLTJf5GCAa3APTWLZ0M05GGlbxeelCB8=; b=dWhRfzn15vyefd2IlqLpeyacf+PExp36dRdsgIbwU1+HK/PuH6eywNbsfNlEFIsuRA i080v1FcPI4yveWZ/VI7E2lEorQtQjDmEIz3VJRqDiFXAkmw2clcUPt2k6xsiGunTJB1 npgFCrxLRUkBU51dn0LYuG+vlbMnwxH4w5p6KENg2iGCYwAaNiG7bChI21mWMTxOd+0y itmy7bSv+pG8X86qWjKuR0mv/zkO03lpez0IXZHIQQhV0/BIXhpugKgC8jRkXtPbfxhM dgplF74jAVYKeYdMSytjoWzNUGgz9mHM6UvDgsb8rBhDS7UkyJ0ChCa6F3gvEmM++nwD PQZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778065315; x=1778670115; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=trYLINoZQm/dLTJf5GCAa3APTWLZ0M05GGlbxeelCB8=; b=fQBQihP4YSSCnZT5P+3kUi3j9trdZ1kDrY8PECdP97gD0e0trtEqa3kLjYSZL/7v24 KBZqxHADJZXfk4TC3rXbKFu7uBcFXf38VSBKUz6/vau3cJt8BSSqSvA9qsRCsJe9oUyx Gb8qRe6+fQscvSD4wVMN/gg3emajnOLKXlUsPPcJLoeVJ1xkcPH5DtVnHKs7dwlYyB+v 4K+RAh44nvhI9GboKs33LPWLdgNM51Jds/cnqGaaFdxu3b4jc9ei5pFf3oQl9wS9gWcI TmDwR6f0cddVWO11jRH6e5Onyvv2LT72ZLBFr2vr5ctIVqASG6bET8340Zw4kGXy4k6m 9jkA== X-Forwarded-Encrypted: i=1; AFNElJ/NoJTSG3dqyrG/MyK2rpiD+/THyiFR4i71hV9FXn/r0KdCzSOblppxiowQhDj+mUJQVOHNoFNMnKCgufg=@vger.kernel.org X-Gm-Message-State: AOJu0Yyr/R7fz05EPbFKQw5bbdPQSQ4q1Pp2U8aAspVzpmVjsckjKNKM 8NbTt0fYlC5m5ZbrB5kiiWjuIOxkTKsXPN1AjoGsEQlpE/KojU4hADwzPBgOAUzD3ac= X-Gm-Gg: AeBDievg9G+LTkgirLcNFK99qZz4ejwK7TkJi06LD7R2tJsy1bwLF8yzcUqYK18/UjD oo5HV9Y6Fpzwj9TVOkYLACzP+7hctXfTOT136saK22ZFgEbyhRHEQ+uXGF6FmH1oD5vTB88ADuo Lw5qRx8fFFMGrESoJTzAKYQEgDEDr/iXNPzi53LvN7aCkz/SDN4MCgVTTRqz+yNGJMB0xDRRin9 I6c3mJHErulCcjASFm53XcCyVD2pYP/01vwwsPM5cDQN6CoronJgeyUUQ4grF3WNZbkahEwnROC woF7MR6fCFrYvysnBs02jQElXxS8Y8+Xi4ykdit7riyUqRkGZxA0s+wZ5G0MCeAOH0dkc/hymXb BW1nBlyxmLU8UhNKEYO5uZ0f+Fok5Wlx2uU6mMaDKvlXTZN4g1rwC5bIGW9V+vuX3X7cbAPsP39 2hnkPodVyzmpRlXj5yWYtVC6gxi8C5fcmkQuuglTxFy4oFeEZiCOXFGJALB8jr1qqhGSiJyVHFQ Pp00eowLts7MaObvp45 X-Received: by 2002:a05:6000:200e:b0:43d:7946:bae5 with SMTP id ffacd0b85a97d-4515da96794mr4957294f8f.42.1778065314993; Wed, 06 May 2026 04:01:54 -0700 (PDT) Received: from [10.211.9.173] ([213.147.98.98]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-450524831cdsm12964172f8f.5.2026.05.06.04.01.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 06 May 2026 04:01:54 -0700 (PDT) Message-ID: <580d74dd-78da-40b3-a373-c27458bfcc9a@kernel.dk> Date: Wed, 6 May 2026 05:01:53 -0600 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 0/2] io_uring: honour submitter's time namespace for ABS timeouts To: Pavel Begunkov , Maoyi Xie Cc: io-uring@vger.kernel.org, linux-kernel@vger.kernel.org References: <20260504153755.1293932-1-maoyi.xie@ntu.edu.sg> Content-Language: en-US From: Jens Axboe In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 5/6/26 3:05 AM, Pavel Begunkov wrote: > On 5/4/26 16:37, Maoyi Xie wrote: >> This series addresses two io_uring code paths that arm an ABS >> hrtimer from a timestamp supplied by the caller. Both paths skip >> the conversion from the submitter's time namespace view to host >> view via timens_ktime_to_host(). The clock is CLOCK_MONOTONIC by >> default, or optionally CLOCK_BOOTTIME. >> >> All four other ABS timer interfaces already do this conversion: >> timer_settime(TIMER_ABSTIME), clock_nanosleep(TIMER_ABSTIME), >> alarm_timer_nsleep(TIMER_ABSTIME), and >> timerfd_settime(TFD_TIMER_ABSTIME). >> >> Patch 1/2 (io_uring/timeout) covers IORING_OP_TIMEOUT and >> IORING_OP_LINK_TIMEOUT via io_parse_user_time(). It is essentially >> the draft Pavel posted on the original thread. I rebased it on >> io_uring-7.1 and verified end to end. >> >> Patch 2/2 (io_uring/wait) covers the IORING_ENTER_ABS_TIMER path >> in io_uring_enter(). That path parses ext_arg->ts inline rather >> than going through io_parse_user_time(). Patch 1/2 therefore does >> not cover it. >> >> Per Pavel and Jens's discussion on the original thread, the two >> sites use two direct timens_ktime_to_host() call sites rather >> than a shared helper. Patch 1/2 also splits the existing >> io_timeout_get_clock() into a flags only io_flags_to_clock(), so >> io_parse_user_time() can resolve the clock without a >> struct io_timeout_data. >> >> SQPOLL is automatically covered. The SQPOLL kernel thread is >> created via create_io_thread() with CLONE_THREAD and no CLONE_NEW* >> flag. copy_namespaces() therefore shares the submitter's nsproxy >> by reference. timens_ktime_to_host() through "current" sees the >> submitter's time_ns when called from the SQPOLL kthread. PoCs for >> both paths confirm this. > > At a quick glance, both look good. I think you had an isolated > reproducer, are you sending it as a liburing test? Would be > greatly appreciated. +1 Yes please, test case for liburing would be great! -- Jens Axboe