Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp217193ybc; Mon, 11 Nov 2019 23:52:17 -0800 (PST) X-Google-Smtp-Source: APXvYqwqtjvZEtqOuJtQnceeOhUUn+NaOgw9F6Mg+Urz7ZcWd/CENoqC4FpagSEncuac9QtmQdnC X-Received: by 2002:a50:d80c:: with SMTP id o12mr31239028edj.251.1573545136907; Mon, 11 Nov 2019 23:52:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573545136; cv=none; d=google.com; s=arc-20160816; b=zefYbW9Pd6qWWM89bxK2osHcCJhsCvEUz0DyETWjxbQxuJTZBSWa6dcxOSAra233o8 iXU6mReF6MW7uUL6Q01CbIO7D99D9VR43ANs3OGyShROrYETRlTePiZOro4EsqG8cuxn ObGC/C72mIftb+f1Fm6cIZhMNeyHmYp7qMMyV/W7PEEtqG8Z6MYHGLIIPzACaMNqR+Qz o5RAKyi2EaA1yD62IHz5kKbAhFfrYLwaDwdTk/K/KMQ6m96RxfJOy6H3kCAWk9z96eEh gtXHECC+rzpUB9KwBn2a0Y3kZYGpG8/HL79TMfemmFkrPTG+a3P9HGTw3iduKeHfTiYr 35HA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:message-id:in-reply-to:subject:cc:to:from :date:dkim-signature; bh=9J79Eguj1xOMc4fb92h3Xp5A3yIeU0L/YK+6R1EqEQg=; b=qnTn1w/lk0uHAPDfq1CihXZnMP9pm+SdKZUw4qG92lS6EHNumSQ8tuunv/OigvWWZI KIY9d8Y/xeyekXPf9Vohi5Uxad0+IT/C24OcryR3kEBqQ6ZmiOlqtu5iavNLK3gT9WDq ioHJzFt2dMx3hPgEvHFpy1Gqh3K8W3575wVPakhI4EavAhxWLRihaoSKPS//0R6o7Shz FKBOqNVA3+m/gtZgNtEzuZPWw9KLk4UzJOsxN1YwVYV/VQvWfmM3p5wCYVHHCkqshSLt 0cyHKV9H05y3AYPV/klSkW49bM2ZnpDyBt401a7ZeKeaN6PVklH66EROnPtOqkx4rRFl Cl6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=DDTlnqrZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id o25si9778015ejg.237.2019.11.11.23.51.51; Mon, 11 Nov 2019 23:52:16 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=DDTlnqrZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1726896AbfKLHuy (ORCPT + 99 others); Tue, 12 Nov 2019 02:50:54 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:39558 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725283AbfKLHux (ORCPT ); Tue, 12 Nov 2019 02:50:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1573545052; 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=9J79Eguj1xOMc4fb92h3Xp5A3yIeU0L/YK+6R1EqEQg=; b=DDTlnqrZ982c1+c7pV4Afr48w8KFwgwmaYoEoORjtbW34snFUOCxHyuGGMxOdaYL3Mz4o3 6ONIGzSjlSoCjN2s5Umji8vpk4r6e/PNCcRvtz+/C6KjEKdO+p+EAjpkWgeHaZLv90xW8o 0qpY467DlYV9mGeovXGDkRx1HVog4BY= 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-324-2vqHdp87O06bEiy0p5g2cg-1; Tue, 12 Nov 2019 02:50:49 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 471A518B5FA0; Tue, 12 Nov 2019 07:50:48 +0000 (UTC) Received: from file01.intranet.prod.int.rdu2.redhat.com (file01.intranet.prod.int.rdu2.redhat.com [10.11.5.7]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 622B360852; Tue, 12 Nov 2019 07:50:42 +0000 (UTC) Received: from file01.intranet.prod.int.rdu2.redhat.com (localhost [127.0.0.1]) by file01.intranet.prod.int.rdu2.redhat.com (8.14.4/8.14.4) with ESMTP id xAC7oge0031234; Tue, 12 Nov 2019 02:50:42 -0500 Received: from localhost (mpatocka@localhost) by file01.intranet.prod.int.rdu2.redhat.com (8.14.4/8.14.4/Submit) with ESMTP id xAC7ogaK031230; Tue, 12 Nov 2019 02:50:42 -0500 X-Authentication-Warning: file01.intranet.prod.int.rdu2.redhat.com: mpatocka owned process doing -bs Date: Tue, 12 Nov 2019 02:50:42 -0500 (EST) From: Mikulas Patocka X-X-Sender: mpatocka@file01.intranet.prod.int.rdu2.redhat.com To: Mike Snitzer cc: Nikos Tsironis , Scott Wood , Ilias Tsitsimpis , dm-devel@redhat.com, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH 1/2] dm-snapshot: fix crash with the realtime kernel In-Reply-To: <20191112011444.GA32220@redhat.com> Message-ID: References: <20191112011444.GA32220@redhat.com> User-Agent: Alpine 2.02 (LRH 1266 2009-07-14) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-MC-Unique: 2vqHdp87O06bEiy0p5g2cg-1 X-Mimecast-Spam-Score: 0 Content-Type: TEXT/PLAIN; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 11 Nov 2019, Mike Snitzer wrote: > On Mon, Nov 11 2019 at 11:37am -0500, > Nikos Tsironis wrote: >=20 > > On 11/11/19 3:59 PM, Mikulas Patocka wrote: > > > Snapshot doesn't work with realtime kernels since the commit f79ae415= b64c. > > > hlist_bl is implemented as a raw spinlock and the code takes two non-= raw > > > spinlocks while holding hlist_bl (non-raw spinlocks are blocking mute= xes > > > in the realtime kernel, so they couldn't be taken inside a raw spinlo= ck). > > >=20 > > > This patch fixes the problem by using non-raw spinlock > > > exception_table_lock instead of the hlist_bl lock. > > >=20 > > > Signed-off-by: Mikulas Patocka > > > Fixes: f79ae415b64c ("dm snapshot: Make exception tables scalable") > > >=20 > >=20 > > Hi Mikulas, > >=20 > > I wasn't aware that hlist_bl is implemented as a raw spinlock in the > > real time kernel. I would expect it to be a standard non-raw spinlock, > > so everything works as expected. But, after digging further in the real > > time tree, I found commit ad7675b15fd87f1 ("list_bl: Make list head > > locking RT safe") which suggests that such a conversion would break > > other parts of the kernel. >=20 > Right, the proper fix is to update list_bl to work on realtime (which I > assume the referenced commit does). I do not want to take this > dm-snapshot specific workaround that open-codes what should be done > within hlist_{bl_lock,unlock}, etc. If we change list_bl to use non-raw spinlock, it fails in dentry lookup=20 code. The dentry code takes a seqlock (which is implemented as preempt=20 disable in the realtime kernel) and then takes a list_bl lock. This is wrong from the real-time perspective (the chain in the hash could= =20 be arbitrarily long, so using non-raw spinlock could cause unbounded=20 wait), however we can't do anything with it. I think that fixing dm-snapshot is way easier than fixing the dentry code.= =20 If you have an idea how to fix the dentry code, tell us. > I'm not yet sure which realtime mailing list and/or maintainers should > be cc'd to further the inclussion of commit ad7675b15fd87f1 -- Nikos do > you? >=20 > Thanks, > Mike Mikulas