Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3484560pxj; Tue, 1 Jun 2021 06:27:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzreX2YvDiQnYDds5gLKOwmoUGTPKj6GmZ4GWi+L3mtoJ17DMjGeTd9EFb0gTYdRjS455dM X-Received: by 2002:a92:2c02:: with SMTP id t2mr21493638ile.233.1622554038684; Tue, 01 Jun 2021 06:27:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622554038; cv=none; d=google.com; s=arc-20160816; b=OWrVp8cQ1u+UQMfSKZfEKxnBMx30x6LfIJB0v8gzY44M1xTMkeiEY/7XScwgMkMOVU 0agWWJTjnD7zBiVUdTbScY0URoifm0bDq04DtoDHE5NlLfyaO/Edg7UHFRh4cI9uIJ7b svZ1pH7W+wgOv+ewfYYbxHumQTv30CoVR0cE7h1tC4n4AjhSFOSTrCKOPt0tFvZoA3A4 mQe/T7Nc0eLiQWlkztkghnr9yTHKKAgLpgaH01TzO0qMg+J7bxRR7z2me+QzBfB/77my 9VOnw2BUz5py09fqs0HbWqeb/ZxLMOUb6MdCfciHJkpA/HMHeXxJmXUz3NntaCmSa5PW IhYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=7TuMZN1E0lbaQ4+hZI+BzEhy4hL1Tvu8HZ6jA5gQoCo=; b=dyLuXVUO3hCP0exWs5Sb3Ndk5fQNnrtI8E9pKf7yKm9dspPoCziftQofKPlqdSJ3Qd m0/ZB70RmKrm3W/wQEilHvYlDfWbTs6tYNM+fbg1p8yTif4RPwF0b5iO7TJKuL9TW9Dk dF8c7M26wOU4Gup97ofJekdExcbOzGLOi8rQrZl+bVIZu1thf1B+RbBtk+WjdBkGMvku ceY3DJoU8jWNrEHYh3HPSoob+8abUeMXOGlSVBsaO/eoilKTapN/WiPxPfK7ggAsOh+N s4QGQcABGKoJN4Ou/em5qixolq7rloOeizjuA8uTBuBHq4paRGdSolkspv4/cMyAGaKK BuUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Or14Bzze; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p31si20005148jac.95.2021.06.01.06.27.04; Tue, 01 Jun 2021 06:27:18 -0700 (PDT) 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=@redhat.com header.s=mimecast20190719 header.b=Or14Bzze; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233960AbhFAN1u (ORCPT + 99 others); Tue, 1 Jun 2021 09:27:50 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:41751 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233938AbhFAN1s (ORCPT ); Tue, 1 Jun 2021 09:27:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622553966; 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: in-reply-to:in-reply-to:references:references; bh=7TuMZN1E0lbaQ4+hZI+BzEhy4hL1Tvu8HZ6jA5gQoCo=; b=Or14BzzecxZJmyl55kwvWtqag5norMUHjZImFtjiUJBOVZpg36JzmYjSzHuXqqiYvdsu9o 0+4tzS7QDiTj6k85TJq5BK+eP68maEiOB28m5poA81aMlqs+Rtc3FDGphrYehpFykAZN0i LMXtvpudp7n+CiLiT2wniYceCwoxYnk= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-497-K2HIVmKNP-izGpM3ukrxfQ-1; Tue, 01 Jun 2021 09:26:03 -0400 X-MC-Unique: K2HIVmKNP-izGpM3ukrxfQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 26CB6107ACC7; Tue, 1 Jun 2021 13:26:01 +0000 (UTC) Received: from T590 (ovpn-12-120.pek2.redhat.com [10.72.12.120]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5ED749936; Tue, 1 Jun 2021 13:25:55 +0000 (UTC) Date: Tue, 1 Jun 2021 21:25:43 +0800 From: Ming Lei To: Hannes Reinecke Cc: Jens Axboe , Christoph Hellwig , linux-block@vger.kernel.org, Linux Kernel Mailinglist Subject: Re: [PATCH] block/genhd: use atomic_t for disk_event->block Message-ID: References: <20210601110145.113365-1-hare@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210601110145.113365-1-hare@suse.de> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 01, 2021 at 01:01:45PM +0200, Hannes Reinecke wrote: > __disk_unblock_events() will call queue_delayed_work() with a '0' argument > under a spin lock. This might cause the queue_work item to be executed > immediately, and run into a deadlock in disk_check_events() waiting for > the lock to be released. Do you have lockdep warning on this 'deadlock'? Executed immediately doesn't mean the work fn is run in the current task context, and it is actually run in one wq worker(task) context, so __queue_work() usually wakes up one wq worker for running the work fn, then there shouldn't be the 'deadlock' you mentioned. Thanks, Ming