Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1359631lql; Tue, 12 Mar 2024 15:02:57 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUWWJHmyRHAZ28w9+v57cfRdWwZjQ+D6hzYbwFxJvQLDQWdtDAuJYJPj8MIz5I7ZiRi/+wel3I3RwQlT6uIUb9ByD/SWZq6dE+or9NNsg== X-Google-Smtp-Source: AGHT+IHhRPASdtvpmY5uGp0p7yozJG7gaZZyY7+GVgGG/x8CCWMizyU0fBjYwOeceD2HFTAgG6vy X-Received: by 2002:a05:6a20:7490:b0:1a3:151e:48af with SMTP id p16-20020a056a20749000b001a3151e48afmr1983965pzd.33.1710280976761; Tue, 12 Mar 2024 15:02:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710280976; cv=pass; d=google.com; s=arc-20160816; b=xmnBvZA3cCa9lnJ4hw2A/KQpXFDAAvpwggsyCCuvDQjz3VpnVqzuL+MaXeA2Boj0F/ HbZJdpKAKftqZ2fKSsq5ZePPoCI6c+c9EVJ35qbDnhGAexiI4pS0XfHXD7Xm22OA4XOE XSoz/OLuHBdwqSdmYPVAkNyEgyzZeEEQ+Tt09IW7aUrkHM7jLM+pLsQJaY6IktQjFPLm Us/obB6q3Zr6CVzpu5dp3f6DDBBFKDZrwERPsClIs5uGIpihZf058FU+HUcGAWgWi1s0 VEI41fPtmmXdvpEjc9/Ua1TmuQehSWApl4NiCf04/c8R9oWrtgiVKhXu/QXUYfXZq2AP Hv1w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=/vXs+O61Mv5vydrV7OLqPBU73CQL7EwumC1ohewx/Hw=; fh=J4m2dlW6jXW243x+NKLjUlDC5CPbANlr0uU2Mh8tkl4=; b=sGxcnjVB5jkpoMNzYO9yNqSehUi6VCRMyHs/zrzy1nusKOC/hkh0FpwMFmXqNqduF9 +JBj5grKUSjolOkUcQscxortiBT3VJX63H+i9ej0zbyKdF/Fx2MwIl567NcDzY/ob9Ml D9QiHbi2W+qQutKO1+l/8uYyO+qu5BTB3oY9+m6UCeh8OvXzzDz8bVjUjJtty3LSFSK+ Z4GFOMNzKZ3sR7T/XA2wYL6IccOaIt+iBjZk5Si6vbh8iMHC5T36y0JkUWTNP1qM3f5F BuJ11/kXj5uU0cJRLDyIEYX9kwJj5b3/q2Miw6vVQhXMZOhDhrdlxNvc5Ia3VrDoFYVp ltrg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel-dk.20230601.gappssmtp.com header.s=20230601 header.b=zffCSK6U; arc=pass (i=1 spf=pass spfdomain=kernel.dk dkim=pass dkdomain=kernel-dk.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-100847-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-100847-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id go16-20020a17090b03d000b002997626b137si132096pjb.61.2024.03.12.15.02.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Mar 2024 15:02:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-100847-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel-dk.20230601.gappssmtp.com header.s=20230601 header.b=zffCSK6U; arc=pass (i=1 spf=pass spfdomain=kernel.dk dkim=pass dkdomain=kernel-dk.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-100847-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-100847-linux.lists.archive=gmail.com@vger.kernel.org" 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 64181B23318 for ; Tue, 12 Mar 2024 22:02:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 81DD7143C7B; Tue, 12 Mar 2024 22:02:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel-dk.20230601.gappssmtp.com header.i=@kernel-dk.20230601.gappssmtp.com header.b="zffCSK6U" Received: from mail-pg1-f179.google.com (mail-pg1-f179.google.com [209.85.215.179]) (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 8862D143C6E for ; Tue, 12 Mar 2024 22:02:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710280933; cv=none; b=a+pQwNUEDFOfdZ+ZHFSaXAkwpowx5enlibYw+ZL6efy6ktiE7P69GTZmqg4X6N/Kl0vEJjtJ21BxCMJbo5fgiif5+sEUtz2jE4x9VlEO95Clqf1N1PmUQXa2CBICZoPTgw8WC4Ln7MRTXQmHAp88qqNTDQ87XSc/SL1wXj70W9Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710280933; c=relaxed/simple; bh=hpOocF6nkIxTwnygMo+B0FnTx/CKPmw71nxhkKfDxvA=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Lk0mOchItwW6/efO2yLqTtj8vYStocF4PiYwjKec5Y8Fpt3HlXUCSb9NSI4a/XopeG3avAJkhZn+HlWoENjWz+hwC9ct3NZRUtifU3TFzwi3pXrKE5LvOZi7A4aogGAiZgiAR0qpPSxNHzEO7h3RzXRgXvuh7tAK9mBJrTKjRaQ= 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.20230601.gappssmtp.com header.i=@kernel-dk.20230601.gappssmtp.com header.b=zffCSK6U; arc=none smtp.client-ip=209.85.215.179 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 Received: by mail-pg1-f179.google.com with SMTP id 41be03b00d2f7-55b5a37acb6so2238438a12.0 for ; Tue, 12 Mar 2024 15:02:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20230601.gappssmtp.com; s=20230601; t=1710280930; x=1710885730; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=/vXs+O61Mv5vydrV7OLqPBU73CQL7EwumC1ohewx/Hw=; b=zffCSK6UgSvS1Bcn0GCJFwJV0+DAF0xtqkYHIsIBQda7ohxHsxBgSmOKovAU6bsek1 baBtGBlyuV0LzS5hZYcXYPWL7nxUsnrmRSrbpYa+9jIUS32inJD5FGWP1J4/kg0zRmL5 dWsTRrkaR//hTzxTqhhGLwRsN7Amt2+VrpBgaHjMN10rHYDXmEF97JQcYUA5j4KYBNsj b0SUEY2tg+f8hxTkv6WU1/pGMu8m3E/QA7KQ5X0ZYxhwe7j84K6BGt7JlahUsvaMq/db //MOPwjStLjgpSUOwFkN/PXjQzv5VXL8rv7/ntapy02SWUBOI3uUM9Rdo1SvHquYD2Rm FFtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710280930; x=1710885730; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=/vXs+O61Mv5vydrV7OLqPBU73CQL7EwumC1ohewx/Hw=; b=TZRZgWZYzqdLdGNkvbAKoHE/a/GStkAsPWpvlLpMSsyZqOeVXvPHEW84kG7SAqKinj 0kLpuKERbWta9/BLsSHMJ1vtcjncRKEPCVooP9IDpYVqOTuQT3Puw9rwlesMV4gVo4cx 6Xu0gFq42R4m2nr4I3qGAxoH0ddb0j9Kq0FbIa/9kDwIvFbnQCP+EpXyn/o5U2vV0w6l nlf2BzHTo/72tsjiJPaW4utUZKuRWlg4rd5Ea3DZRQR/XvEFmHvNwtcNwCe6vwT6O04W nVsYhn11e2IQ+b/38gGpMi0ni4Iz5u3UYzvwxSnFybOxKqFgP7T2W45cQcc68LjJLJS/ peDA== X-Forwarded-Encrypted: i=1; AJvYcCUvI60DSCJbnvGX5ykanGnyFJzpBR94B6/reawsOtN0BJKE0Y0rBr42QUCYv+mc76uapLGdcpKf+XDJJfMm2Ag4hAxmSJCEZ4sWtpwp X-Gm-Message-State: AOJu0YyEWj4L16Utkg8DDZBiC0EMbHV0Egxj2XWENonTnQABA0yaoqqS ZdD6UMy5a8kUAIv3Kx6Mkebf6c9PSaNO9Y/qw28ihmr/mrJk/a9Fpjz6QneVdJk= X-Received: by 2002:a05:6a00:987:b0:6e6:3b49:c4d with SMTP id u7-20020a056a00098700b006e63b490c4dmr3404100pfg.2.1710280930324; Tue, 12 Mar 2024 15:02:10 -0700 (PDT) Received: from [192.168.1.150] ([198.8.77.194]) by smtp.gmail.com with ESMTPSA id r19-20020aa78453000000b006e627d0e97bsm6527711pfn.181.2024.03.12.15.02.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 12 Mar 2024 15:02:09 -0700 (PDT) Message-ID: Date: Tue, 12 Mar 2024 16:02:08 -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: [GIT PULL] Networking for v6.9 Content-Language: en-US To: Jakub Kicinski Cc: Linus Torvalds , Johannes Thumshirn , davem@davemloft.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, pabeni@redhat.com, bpf@vger.kernel.org, Tejun Heo References: <20240312042504.1835743-1-kuba@kernel.org> <20240312133427.1a744844@kernel.org> <20240312134739.248e6bd3@kernel.org> <39c3c4dc-d852-40b3-a662-6202c5422acf@kernel.dk> <20240312144806.5f9c5d8e@kernel.org> <20240312145455.403b713f@kicinski-fedora-PC1C0HJN> From: Jens Axboe In-Reply-To: <20240312145455.403b713f@kicinski-fedora-PC1C0HJN> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 3/12/24 3:55 PM, Jakub Kicinski wrote: > On Tue, 12 Mar 2024 14:48:06 -0700 Jakub Kicinski wrote: >>> index 9a85bfbbc45a..646b50e1c914 100644 >>> --- a/block/blk-iocost.c >>> +++ b/block/blk-iocost.c >>> @@ -1044,7 +1044,7 @@ static void ioc_now(struct ioc *ioc, struct ioc_now *now) >>> unsigned seq; >>> u64 vrate; >>> >>> - now->now_ns = blk_time_get_ns(); >>> + now->now_ns = ktime_get_ns(); >>> now->now = ktime_to_us(now->now_ns); >>> vrate = atomic64_read(&ioc->vtime_rate); >> >> Let me try this, 'cause doing the revert while listening to some >> meeting is beyond me :) > > That fixes the crash for me! OK good, thanks for testing! Linus, can you just pick up the below? I can prep a pull as well, but not ready to send the remaining merge window fixes just yet. From fb280ede759d1918fec03bc22d32eeaaa45500bb Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Tue, 12 Mar 2024 15:58:41 -0600 Subject: [PATCH] block: limit block time caching to in_task() context We should not have any callers of this from non-task context, but Jakub ran [1] into one from blk-iocost. Rather than risk running into others, or future ones, just limit blk_time_get_ns() to when it is called from a task. Any other usage is invalid. [1] https://lore.kernel.org/lkml/CAHk-=wiOaBLqarS2uFhM1YdwOvCX4CZaWkeyNDY1zONpbYw2ig@mail.gmail.com/ Fixes: da4c8c3d0975 ("block: cache current nsec time in struct blk_plug") Reported-by: Jakub Kicinski Signed-off-by: Jens Axboe --- block/blk.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/blk.h b/block/blk.h index a19b7b42e650..5cac4e29ae17 100644 --- a/block/blk.h +++ b/block/blk.h @@ -534,7 +534,7 @@ static inline u64 blk_time_get_ns(void) { struct blk_plug *plug = current->plug; - if (!plug) + if (!plug || !in_task()) return ktime_get_ns(); /* -- 2.43.0 -- Jens Axboe