From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1A2F9EB64D7 for ; Mon, 26 Jun 2023 10:48:55 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 959078D0002; Mon, 26 Jun 2023 06:48:54 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 90AEA8D0001; Mon, 26 Jun 2023 06:48:54 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7D2688D0002; Mon, 26 Jun 2023 06:48:54 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 6BD0F8D0001 for ; Mon, 26 Jun 2023 06:48:54 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 3ECEA1C7AC2 for ; Mon, 26 Jun 2023 10:48:54 +0000 (UTC) X-FDA: 80944576188.15.7386838 Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) by imf22.hostedemail.com (Postfix) with ESMTP id 65F21C0020 for ; Mon, 26 Jun 2023 10:48:50 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=infradead.org header.s=desiato.20200630 header.b=GiwgVqpT; spf=none (imf22.hostedemail.com: domain of peterz@infradead.org has no SPF policy when checking 90.155.92.199) smtp.mailfrom=peterz@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1687776532; h=from:from:sender: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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=KPR4Pvi5WUrVNlNKwoDKt99z94KfDRPb9X9tpIhV/SQ=; b=v1vG3MrBWin/0zMRJSNx9ogf4yUIfZV+hKJVuNXSnJ2sL/m4xZqiMQScplqEZFnMz6UlTO AjIRGt20mnCQiWMPn0MICAoYUgpAHFpH/tdQyYjDC9KT7tCGgUC/Y7LbwRnSHw5ZJIPfYu ESddM9b7t8CA907XaKk2bxnNUCG2uW4= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=infradead.org header.s=desiato.20200630 header.b=GiwgVqpT; spf=none (imf22.hostedemail.com: domain of peterz@infradead.org has no SPF policy when checking 90.155.92.199) smtp.mailfrom=peterz@infradead.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1687776532; a=rsa-sha256; cv=none; b=YKpLUhAHE75DrQC/3GboHzXfzfC73kt+VhDmPX2IuxscTocPWXkQu+x4CgO66hGoAr4E7T 4Wf3v9q6isMZWHk+VDWvJweZqB9yFdL71AHTl4aob14UQSDnfdkSmXqr+KIePRXL+QsdBt 4bSWc6xYm4iE87i/JTeQotrs5UnqFeo= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=KPR4Pvi5WUrVNlNKwoDKt99z94KfDRPb9X9tpIhV/SQ=; b=GiwgVqpTSY0vY2SKRSak7ePJsG 8GFfvo/fbOS07buXsdP6E2tCiQ7tsvjwrkbXzX0e6dxmr2Q4GaRKl9TtUwEcq+M1iud7ZnvH2chO3 m8p5UKwTuFfFq022mZrJvxb3q5IyoogODhhM0Oa3CVNBw2XkIKn/naiH0zfqpu4KzRE0O+gWsxjae yP1sZVIg+psw3DoF6n9GlxHS1myaY6L4zeiDxeC1dDJZkf+gYyMIY0ccJHLTMO2EeR/dbZGQz6u71 A8RPhWQzmqYwYL5ow+CNm2uOXFuoKZNdKzlQwslIG7CfGX9d9vYzNmxnWKghntB17C2QHWy6WVdCM KnTbqvZA==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1qDjlp-003xN7-22; Mon, 26 Jun 2023 10:48:33 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 30A9E300118; Mon, 26 Jun 2023 12:48:31 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 179312439687E; Mon, 26 Jun 2023 12:48:31 +0200 (CEST) Date: Mon, 26 Jun 2023 12:48:31 +0200 From: Peter Zijlstra To: Tetsuo Handa Cc: Sebastian Andrzej Siewior , linux-mm@kvack.org, linux-kernel@vger.kernel.org, "Luis Claudio R. Goncalves" , Andrew Morton , Boqun Feng , Ingo Molnar , John Ogness , Mel Gorman , Michal Hocko , Petr Mladek , Thomas Gleixner , Waiman Long , Will Deacon Subject: Re: [PATCH v2 1/2] seqlock: Do the lockdep annotation before locking in do_write_seqcount_begin_nested() Message-ID: <20230626104831.GT4253@hirez.programming.kicks-ass.net> References: <20230623171232.892937-1-bigeasy@linutronix.de> <20230623171232.892937-2-bigeasy@linutronix.de> <20230626081254.XmorFrhs@linutronix.de> <0a0c768c-227d-c0cd-1b91-5a884d161c1b@I-love.SAKURA.ne.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0a0c768c-227d-c0cd-1b91-5a884d161c1b@I-love.SAKURA.ne.jp> X-Rspamd-Queue-Id: 65F21C0020 X-Rspam-User: X-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jEwYAXyV8alGxyi5dDxyFwVSf/i3ezloYu+1ihsYrrapspkgBxEx05Z49DiLncOajLVrXHKEdz3lpvGiPG9QaBoToOFxMImYdii2OvwUgtDemc5EDWmK8SIwjLX9nEl/EWyEVwGwQrFkbWO9xp2K63YpBPhhXR9bB5A2jUQndG0xwXuL5qsiZbIP5OQYNuTM4IwPPGOM23CL3+PfS7QMGol0SkbVoypud4U9Rc9WN09DNKpoWpf5mOn7 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, Jun 26, 2023 at 06:25:56PM +0900, Tetsuo Handa wrote: > On 2023/06/26 17:12, Sebastian Andrzej Siewior wrote: > > On 2023-06-24 15:54:12 [+0900], Tetsuo Handa wrote: > >> Why not to do the same on the end side? > >> > >> static inline void do_write_seqcount_end(seqcount_t *s) > >> { > >> - seqcount_release(&s->dep_map, _RET_IP_); > >> do_raw_write_seqcount_end(s); > >> + seqcount_release(&s->dep_map, _RET_IP_); > >> } > > > > I don't have a compelling argument for doing it. It is probably better > > to release the lock from lockdep's point of view and then really release > > it (so it can't be acquired before it is released). > > We must do it because this is a source of possible printk() deadlock. > Otherwise, I will nack on PATCH 2/2. Don't be like that... just hate on prink like the rest of us. In fact, i've been patching out the actual printk code for years because its unusable garbage. Will this actually still be a problem once all the fancy printk stuff lands? That shouldn't do synchronous prints except to 'atomic' consoles by default IIRC.