Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp16158440rwd; Mon, 26 Jun 2023 06:33:59 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6EQoN0z6FRrKsA1VS4GOLgUiwMupdMH47oGyHkrkG/zB+k+7UKBwVnC/DC7utBepOrj2oP X-Received: by 2002:a17:907:6e10:b0:991:f207:411e with SMTP id sd16-20020a1709076e1000b00991f207411emr696080ejc.69.1687786439667; Mon, 26 Jun 2023 06:33:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687786439; cv=none; d=google.com; s=arc-20160816; b=lajDxETKg5Y4VtF9GQU+XOeQZ0OxrhqAQnyFHv2JF4du48hK5F9PKm7PClrO9+aOKN z1GwyuzQUTScPtgK+wkJ0FY/0OuQk+vNRY537W1OVAHYrfnFep6P0s0/CIen2w+Xw8AU xqEbAl5KCpop6t2htMuiOftlkOOn9ZA4MLer0QjJ2xuu/mwltYOVNavzuDPXuLi7DYgY 8z67Dzhj2h/7e/Mg1vnEWQMpFedDjMdBfx7MxCNTiy1BIG7O5M7kovZexR+9K0sc9VYz rWNGG7m0xz6z42a4+THbmI24BPKuwrA5due8F+xAJq23+R7tCEFdQu2wEQSC3HQAEAjX opzg== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:dkim-signature:dkim-signature:date; bh=dJ4Di89KqvgxUq7+UJZlhQS8x66yPkUdMBNqO/L1Rec=; fh=4xI3hKY7+L1mNidn2HeqONiezWPaGtsQ/iQz9kpm47Y=; b=P1BkdIj5IukuFXR7J5Mg9dFcQ3DJRuuqgypXtr3dngF5WD0K/qPcd3mzYqdu8tVww3 4QuJmTsH46LCKLE9vTGq3l4S6UYidxhHel8XI9pIsSYY55XZ77102XJB5H+T2fM7AiLM o45MVgWSF7f+vX6E3Wq3z1JBfORlPG7zD17BIq2tKok7weq2NM7kdSdU2szjf0cHQGjG DD2UF1LTBcs3Cfr/1ISPDqXD07XmgvdeLCJMZ05gcsXL0+BWa/LBi0VI3046lyYbIikS /iMp93zQESn+D5CZlr+WLsrlLdK6/VT810aGLvtQt4PniG1iOaJy3MkSqpGMdepLr007 Sh0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=fgyoaiRn; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k7-20020a170906a38700b0098295eed929si2823010ejz.998.2023.06.26.06.33.35; Mon, 26 Jun 2023 06:33:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=fgyoaiRn; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230372AbjFZNNI (ORCPT + 99 others); Mon, 26 Jun 2023 09:13:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229904AbjFZNNG (ORCPT ); Mon, 26 Jun 2023 09:13:06 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1545CB9 for ; Mon, 26 Jun 2023 06:13:06 -0700 (PDT) Date: Mon, 26 Jun 2023 15:13:02 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1687785184; 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=dJ4Di89KqvgxUq7+UJZlhQS8x66yPkUdMBNqO/L1Rec=; b=fgyoaiRnwPpzjij3YonvglSVuPKoz7tB3jQL5S2xPWD9go0IqdjyIJM5VK+Xz4tS0jJxTI ReAkJ5oDzqXxNggzgyJS+M9Tfbx8t0kUWB3xaDftWRbpBhT5InNws4U5cdxcwj/GdqV0TO 7UVq5i/DuT0/FAAkWfefQ8Y+VljTvfmoQmaFoAL+HysHyZVtQqGgq1E//aXWGI+zOgdOYY onS7Ch5mEyw7jX1SY25gM+FMwNLGjpqj3ygYpEyYNVvQYdu3IM3bEvJuZIg2uHzUSl8UEl hrzC0wFRLAD1tqjYQ1c6Fki3akiex2AnDCqwvkUwvu2fDvQQsaQQoRyyIclfqQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1687785184; 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=dJ4Di89KqvgxUq7+UJZlhQS8x66yPkUdMBNqO/L1Rec=; b=/JKRY25+CV9oEwP8w1J9orRkTduJ2mTQKJYT8OIYSOx7TZY4KzUNdO0991I2iFRgkPYOg/ cqKj0QPwj7wNfhAQ== From: Sebastian Andrzej Siewior To: Peter Zijlstra Cc: Tetsuo Handa , 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: <20230626131302.JsFNvwps@linutronix.de> 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> <20230626104831.GT4253@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <20230626104831.GT4253@hirez.programming.kicks-ass.net> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2023-06-26 12:48:31 [+0200], Peter Zijlstra wrote: >=20 > 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. The fancy printk stuff should have synchronous printing in emergency situations and threaded printing by default. But then I hear John saying that there might be push back because atomic consoles may not be available everywhere=E2=80=A6 Anyway, the requirement for the deadlock to trigger, that Tetsuo Handa is concerned here: - lockdep enabled - console and tty in use. - tty_insert_flip_string_and_push_buffer() on one CPU with tty_port::lock acquired followed with a memory allocation blocking on read_seqbegin(&zonelist_update_seq) due the writer - memory hotplug =3D> __build_all_zonelists() acquiring write_seqlock(&zonelist_update_seq) and now lockdep creates a splat. This is accounted for if the lockdep annotation comes first (1/2 of the series). But the unlock annotation of the seq unlock operation may still create a splat so a possibility for a deadlock remains. The requirement is _high_ and it hardly justifies ugly code. Sebastian