Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3501290pxu; Tue, 15 Dec 2020 08:26:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJwHc3raCwWJpbEbhe+AJwcWITgCqz0Y8PyVR7Hl5QAv0pDOkJKyBL5Aao8dwJWvWB40ItJw X-Received: by 2002:aa7:cb10:: with SMTP id s16mr4240406edt.304.1608049563409; Tue, 15 Dec 2020 08:26:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608049563; cv=none; d=google.com; s=arc-20160816; b=RNNSa7n4A5rF5YUL3SlLSuBOW/W1MZFYZKb5rK3tL6rGDhfcO+gyP5veYc338QZs30 D+IIJppdt9Zy67eT+pYCSqFQ/7imBFH8MYdEGT2b34ia99lRtM2fonJAVQXltfhdfv5t cFSTuKDYSNtt4pvCQc7k3g0+N5YYUEB/z03pVC4uTHizAyd9eJyfAvEkoSsHskhxB9/4 Be5n/crj9TwsCp6TrqnGZVJNN5bkyOk8jz0wZ8TCw90daRQIgD8PvB2dPmIcIOQYyQXY Xp6dvnM0qM85NRREYiXy1L0YuQ9m3aUzpjqUtAkOKL8NrMr4bEIt8ujhUAnPKHY27dVl c5TA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=diFiOdC7jji4ApRY/TN7q4luYnhO42+izDOiqW6c7fQ=; b=cDbhKrcqBbkULBeizkSdwah5feow269sOnsHej1GC7+38kWAog173JCj8N5/cpIX4x /ycEsZ9Gxf8tg0sDQ+HPKO+IRi2wgM8SdYYyBGXdn5nW8zOrVp60oIAbXIYOcc8HgdDb 01KElE3jM3eCExNC6pmRTrPFvCL8M52zyvvha3hkrgoD8Qqy59joYHA5MXLUc1m10UM8 fQRFma4iwNMHPrC3XH8rmOXagqxmZHuEzx5PSiSyTn70Pu7ormcaRigWuRQTNySzz++K SVmGQW6X6RyONpTJErUjDdK4syERjo9Y4G7CiwDk6S/XOgpFgjg5ubxbPqHd8jjrNm1i esDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=hQiDU6yz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d14si1086672edj.545.2020.12.15.08.25.38; Tue, 15 Dec 2020 08:26:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=hQiDU6yz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730952AbgLOQTj (ORCPT + 99 others); Tue, 15 Dec 2020 11:19:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730744AbgLOQSm (ORCPT ); Tue, 15 Dec 2020 11:18:42 -0500 Received: from mail-il1-x142.google.com (mail-il1-x142.google.com [IPv6:2607:f8b0:4864:20::142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6EDA0C0617A7 for ; Tue, 15 Dec 2020 08:18:02 -0800 (PST) Received: by mail-il1-x142.google.com with SMTP id r17so19693191ilo.11 for ; Tue, 15 Dec 2020 08:18:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=diFiOdC7jji4ApRY/TN7q4luYnhO42+izDOiqW6c7fQ=; b=hQiDU6yz9paRrn/W1FNtwDtULkqHPLtXCn25y/0+TcdmbJHBjmxRjJooAwo88AHHYo GWlaKO9W1fmFP2jWgFhgh4aQn4igIqu5dcHf8kKhQsjTs5XaojT6fB0kfy5cCsjqBkMX DaloqW6SHdXcFPT4+53Lv3NRDvv4kU6HfwNkKxQZASOb6WE2dhRYTCkZX3zaXwZu52oi yu3YAcsq4yBnKbC9SYeQXEDN10LS7Kx7SjI4AH68SEWC93LRAX6hd4u4ZVTUHBWuJC3U 4zrCQ5SexpPVD8VIH+gae+aCEby/KtQ8ozpGagIWTz5lECzsZTv8IMfuw1M/BA+JcOqL kb8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=diFiOdC7jji4ApRY/TN7q4luYnhO42+izDOiqW6c7fQ=; b=cgRszZ+PfOgUcLWY9izEBF7g95Ln2cPEusi7iFzat4ALYnNCEfoY9pDQq8D4v4hKMX lF0rywDAhVi3w7J4f+vmiEup0pkXbsorExPCqe8YFUQgVe42eCFfLRroBu4kGZSSfqQM akTriobKjXATRiuov3yAaonSWN+ibIcdxNWdm6ZQ8R8/Nf/BNe7TxY9a3jdHNDcKJlxm TwsSI1PZrU+jkbYX8IdanUBuS+EdUzVfUr9rTFi1s/AIpsqmuhzB9WArX74DgY0luRoM J0knXTvRfDu82GFVHyTmzden6NJJdcdH0LCJiJBYZIdXVfF6Gpux1D9YZCBxeFG1HVzP DHrA== X-Gm-Message-State: AOAM532drUkA193rbM2AbgSsqCjqZHG3Y2JxheRcV8UObVPA8nHht2kA Tn4fs+Z9Yue8T8Shb4R2/60ZJV6hfgZ60g== X-Received: by 2002:a05:6e02:1185:: with SMTP id y5mr42582830ili.119.1608049081777; Tue, 15 Dec 2020 08:18:01 -0800 (PST) Received: from [192.168.1.30] ([65.144.74.34]) by smtp.gmail.com with ESMTPSA id r5sm13084632ile.80.2020.12.15.08.18.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 15 Dec 2020 08:18:01 -0800 (PST) Subject: Re: Lockdep warning on io_file_data_ref_zero() with 5.10-rc5 To: Xiaoguang Wang , Pavel Begunkov , Nadav Amit Cc: linux-fsdevel@vger.kernel.org, io-uring@vger.kernel.org, LKML , Alexander Viro References: <13baf2c4-a403-41fc-87ca-6f5cb7999692@kernel.dk> From: Jens Axboe Message-ID: <8bb82057-1fdf-cb99-0549-2a1a27600d15@kernel.dk> Date: Tue, 15 Dec 2020 09:18:00 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/14/20 11:58 PM, Xiaoguang Wang wrote: > hi, > >> On 11/28/20 5:13 PM, Pavel Begunkov wrote: >>> On 28/11/2020 23:59, Nadav Amit wrote: >>>> Hello Pavel, >>>> >>>> I got the following lockdep splat while rebasing my work on 5.10-rc5 on the >>>> kernel (based on 5.10-rc5+). >>>> >>>> I did not actually confirm that the problem is triggered without my changes, >>>> as my iouring workload requires some kernel changes (not iouring changes), >>>> yet IMHO it seems pretty clear that this is a result of your commit >>>> e297822b20e7f ("io_uring: order refnode recyclingā€¯), that acquires a lock in >>>> io_file_data_ref_zero() inside a softirq context. >>> >>> Yeah, that's true. It was already reported by syzkaller and fixed by Jens, but >>> queued for 5.11. Thanks for letting know anyway! >>> >>> https://lore.kernel.org/io-uring/948d2d3b-5f36-034d-28e6-7490343a5b59@kernel.dk/T/#t >>> >>> >>> Jens, I think it's for the best to add it for 5.10, at least so that lockdep >>> doesn't complain. >> >> Yeah maybe, though it's "just" a lockdep issue, it can't trigger any >> deadlocks. I'd rather just keep it in 5.11 and ensure it goes to stable. >> This isn't new in this series. > Sorry, I'm not familiar with lockdep implementation, here I wonder why you say > it can't trigger any deadlocks, looking at that the syzbot report, seems that > the deadlock may happen. Because the only time the lock is actually grabbed in bh context is when it has dropped to zero and is no longer used. The classic deadlock for this is if regular use has both contexts, so you can get: CPU0 CPU1 grab_lock() bh context, grab_lock() deadlock. But this simply cannot happen here, as by the time we get to grabbing it from bh context, there can by definition be no other users of it left (or new ones). -- Jens Axboe