Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp2738440rwb; Mon, 7 Aug 2023 02:37:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHgoa+UaxJ13FFXAS5A18oCpg9cjld7mX8h1aKu8DOb3Brd97TjFLg5Pvm+DuWG8PDHcE5Q X-Received: by 2002:aa7:c30e:0:b0:523:3510:b22 with SMTP id l14-20020aa7c30e000000b0052335100b22mr2544231edq.42.1691401077344; Mon, 07 Aug 2023 02:37:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691401077; cv=none; d=google.com; s=arc-20160816; b=Zy/lPfXrib52udJqAvhuKbOKE/TudGuNttoidrKBBZ3+WywaomBXs6L3YHYFXS3fxb 3N4f0rpIaclHgNjBadqyYsf42o/zzO7MAy9W00H6Ys9jD4iw0qM8Snb0F5zcN7xhWOQG Fvwlbewr8HDHauKqeC8YGob+QuuRAjcaQ85i28orDkdKwzftpCz0t9rWk2Sq73QCpG2n SDX7OHs3BA40anDBrg0SbQ3ecI6iY5HwQ0lawwuUXPS0C1btMc5AqruWPEtR7AvBf84O oyzRt8Um/OVd0EtqZjcSOeoB8rQIZfCdMsricDxg/+zgv/TeJ5Bb95fOlVjgkekX/of3 L15A== 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=dHv+Q+zckl8kRXv8jZYiaBCAeHh0V9XrS6OghMZOl/8=; fh=9Q32ECBLm7JcmJ1+w+koopOhY6nw29RvDlaj1KYNFF8=; b=lvdXMervcUaD22GSgQCYNoafSJKqhoqFFEaozjl8qaN3Vp9lnNPa7tLduodDZMqqns FYx5fpfuyXIcYsWXIqF58PqJPeEj0f0ki+SIOcgxNFBIW8kY0mrnnINf1uYVToAhyDVd g41BevqKuMS5NR6QZCDaNPNJKEWYGXMLZ9lFP/MAuz4LM0cCfMTAyFI4cGHhTk90EmEw CTMGgrcRdhpPtuWSjw/0FfFDOKolhB+ckiL1Juiwu7F/J/G2PAe5bdH3saXfU5LoNpxC wC8EXbRfvlmxYNFN0tGnj+9442dq6neq1Q1m8oayguVnhAQREVgyRmaWt+KhmEdC6NZs 0IbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=TpcC5MgY; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b10-20020aa7cd0a000000b005221b934ceasi5439018edw.225.2023.08.07.02.37.29; Mon, 07 Aug 2023 02:37:57 -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=@suse.com header.s=susede1 header.b=TpcC5MgY; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229653AbjHGIUc (ORCPT + 99 others); Mon, 7 Aug 2023 04:20:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54478 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229990AbjHGIU3 (ORCPT ); Mon, 7 Aug 2023 04:20:29 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0601E171E for ; Mon, 7 Aug 2023 01:20:27 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 7687D1F460; Mon, 7 Aug 2023 08:20:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1691396426; h=from:from:reply-to: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=dHv+Q+zckl8kRXv8jZYiaBCAeHh0V9XrS6OghMZOl/8=; b=TpcC5MgYdb1YFBzo2cyT8b5I1+d31p+KNyDG3zYN3icX+h+/4/gQIVH/F1sOnx9Sym58YE dwdBmjl6C9k3yBN8c22mxXQcxzPvejbKejsk0c3vvOvO0cvueOPk8tdiJK/B4gRmM9mRSx PhF4yNPKpNkIoJbjJoXyh76vUMq0U1g= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 2F7F513487; Mon, 7 Aug 2023 08:20:26 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id ZFQdCUqp0GTSfgAAMHmgww (envelope-from ); Mon, 07 Aug 2023 08:20:26 +0000 Date: Mon, 7 Aug 2023 10:20:25 +0200 From: Michal Hocko To: Tetsuo Handa Cc: Sebastian Andrzej Siewior , Andrew Morton , Petr Mladek , linux-mm@kvack.org, linux-kernel@vger.kernel.org, "Luis Claudio R. Goncalves" , Boqun Feng , Ingo Molnar , John Ogness , Mel Gorman , Peter Zijlstra , 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: References: <20230626081254.XmorFrhs@linutronix.de> <20230727151029.e_M9bi8N@linutronix.de> <649fa1a7-4efd-8cc7-92c7-ac7944adc283@I-love.SAKURA.ne.jp> <60d4dc52-9281-9266-4294-b514bd09e6e8@I-love.SAKURA.ne.jp> <2505f6d3-5a10-49e7-960f-12c31a62a366@I-love.SAKURA.ne.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2505f6d3-5a10-49e7-960f-12c31a62a366@I-love.SAKURA.ne.jp> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS 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 Fri 04-08-23 22:27:22, Tetsuo Handa wrote: > On 2023/08/03 23:49, Michal Hocko wrote: > > On Thu 03-08-23 22:18:10, Tetsuo Handa wrote: > >> On 2023/07/31 23:25, Michal Hocko wrote: > >>> On Sat 29-07-23 20:05:43, Tetsuo Handa wrote: > >>>> On 2023/07/29 14:31, Tetsuo Handa wrote: > >>>>> On 2023/07/28 0:10, Sebastian Andrzej Siewior wrote: > >>>>>> On 2023-06-28 21:14:16 [+0900], Tetsuo Handa wrote: > >>>>>>>> Anyway, please do not do this change only because of printk(). > >>>>>>>> IMHO, the current ordering is more logical and the printk() problem > >>>>>>>> should be solved another way. > >>>>>>> > >>>>>>> Then, since [PATCH 1/2] cannot be applied, [PATCH 2/2] is automatically > >>>>>>> rejected. > >>>>>> > >>>>>> My understanding is that this patch gets applied and your objection will > >>>>>> be noted. > >>>>> > >>>>> My preference is that zonelist_update_seq is not checked by !__GFP_DIRECT_RECLAIM > >>>>> allocations, which is a low-hanging fruit towards GFP_LOCKLESS mentioned at > >>>>> https://lkml.kernel.org/r/ZG3+l4qcCWTPtSMD@dhcp22.suse.cz and > >>>>> https://lkml.kernel.org/r/ZJWWpGZMJIADQvRS@dhcp22.suse.cz . > >>>>> > >>>>> Maybe we can defer checking zonelist_update_seq till retry check like below, > >>>>> for this is really an infrequent event. > >>>>> > >>>> > >>>> An updated version with comments added. > >>> > >>> Seriously, don't you see how hairy all this is? And for what? Nitpicking > >>> something that doesn't seem to be a real problem in the first place? > >> > >> Seriously, can't you find "zonelist_update_seq is not checked by !__GFP_DIRECT_RECLAIM > >> allocations, which is a low-hanging fruit towards GFP_LOCKLESS" !? > > > > I do not think we have concluded that we want to support GFP_LOCKLESS. > > This might be trivial straightforward now but it imposes some constrains > > for future maintainability. So far we haven't heard about many usecases > > where this would be needed and a single one is not sufficient IMHO. > > When you introduced a word GFP_LOCKLESS in the link above, I was wondering the meaning > of "LESS" part. Since we know that it is difficult to achieve "hold 0 lock during memory > allocation", "hold least locks during memory allocation" will be at best. Therefore, > GFP_LOCKLESS is as misleading name as GFP_ATOMIC. GFP_LOCK_LEAST or GFP_LEAST_LOCKS will > represent the real behavior better. I am not sure I understand what least locks mean actually. I guess what you wanted to say is that there are no locks or other synchronization means with external visibility/dependencies used. In other words a mode which can be called from any locking context. That would be certainly possible and whether any internal locks are used or not is an implementation detail as long as the no external visibility/dependencies rule is held. I do not really want to start the naming discussion as it is not really clear we want/need to provide such a strong guarantee. -- Michal Hocko SUSE Labs