Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp4484673rwd; Tue, 23 May 2023 08:17:06 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5QxMNKf5bHOmOwq2LImFZ7Ncw4IKT90KFPW6Aqh2ChPgrIrVe5XxqJmRGVj2eWJMqxPfmd X-Received: by 2002:a05:6a21:9205:b0:ec:e5bb:1bc4 with SMTP id tl5-20020a056a21920500b000ece5bb1bc4mr11766393pzb.6.1684855025675; Tue, 23 May 2023 08:17:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684855025; cv=none; d=google.com; s=arc-20160816; b=ShPnhVrXofx21faMWkGKXYwiOepFd+sEBNQdL28GiaW41WDzaQeR3ZWfhyx9Jw7aQY gHPPn24mEUlwptXTBb00aOyjgWtwYbJClGc9uiCVghUwMfXCkrF86JxdwpJFUbsgzfCF e/f9Bvdc7Zkyw0LAvLfGkbr8ADGxZfRW/Hb9LQ6ZfODy0DmHvzC9zAapCYZCFsDSrkzp /k+GHcuIK5vUnfVwh9WaUPY/O4lbjRoTEwbDkYaXuzxQYWNaEsBVfvADhQgzgw3y/hOp w/GfJJzLEa5uotHYXKcWDj9SmU4TQfy/Gx3aqQ4JLKMsaASpS37lm7hy4DX3VyQtzmrY yaOw== 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=neW8xWDF9dDcKsZp/aT07RgnmDTayd37jG9hz6hzonQ=; b=Y4wHc37yhNpjRyp0ZvINIrHEFlxteoBqKB2YytTR8J0QDHN5sdfmUr7Wq+OnIXbWPZ AXoCT9TRjY0UmzGBvpuer40NH4UVEhNJoIn7D6+W6zG4haOyf7LfTOWoT4+BrULheSPo ap7eax1+MpsxeDcYR8fT/z5ykwptnNmZ6ak9W2MHew63/D949ev7tBh0OqxccT3U5MZn WzLK8JR6l5zB7FRBmes3O9VdLr4D12P4dEXVhuMtMWklR7x9mXwc9Lcfu2n6XqXTfBlR myr3yjttlzbS11AIp0SNEFlzrcK8X+KNoTUJYz6Zc92epfnGtl98E1iT8Q2DtuQ0OZfA xERA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=EmF0pl3G; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v16-20020a637a10000000b005348cc20de8si6655912pgc.846.2023.05.23.08.16.52; Tue, 23 May 2023 08:17:05 -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=@infradead.org header.s=bombadil.20210309 header.b=EmF0pl3G; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237041AbjEWPOQ (ORCPT + 99 others); Tue, 23 May 2023 11:14:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53600 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237600AbjEWPOH (ORCPT ); Tue, 23 May 2023 11:14:07 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1BDB2126 for ; Tue, 23 May 2023 08:13:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; 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=neW8xWDF9dDcKsZp/aT07RgnmDTayd37jG9hz6hzonQ=; b=EmF0pl3GeWh750bwRO27xgDDcP 6hwKFN8pdjjar3LqX5IyDTRbC8dckdXFqEw1oLFlhTQO6B1kHOmveNM9z6CYqvp570+f6fB37a7Wl jFBr06sVP4Uz2T686HXrHyiRKNb4WjcnLeIewSwA4Av2G1L13ek1buPJgJfMIwA776ME5Ky0Wvx93 mHrdUJo3qK2BTUWIC7RVID9jdtIrYS7j4FDEhiJOxU0P4Ow4b/h6Gi3sWYq9P53mYP0/xF0obNEPT U9iiR0eHUPw+MSIj1HyfGgvDIEy9VC2/LGuRT9CCDVPnk53+vS36P+x5v4RWaqxUkrcfTKUWWh5Ws 13UDhjLg==; Received: from hch by bombadil.infradead.org with local (Exim 4.96 #2 (Red Hat Linux)) id 1q1Thr-00AbBM-0C; Tue, 23 May 2023 15:13:47 +0000 Date: Tue, 23 May 2023 08:13:47 -0700 From: Christoph Hellwig To: Uladzislau Rezki Cc: Christoph Hellwig , linux-mm@kvack.org, Andrew Morton , LKML , Baoquan He , Lorenzo Stoakes , Matthew Wilcox , "Liam R . Howlett" , Dave Chinner , "Paul E . McKenney" , Joel Fernandes , Oleksiy Avramchenko Subject: Re: [PATCH 4/9] mm: vmalloc: Add a per-CPU-zone infrastructure Message-ID: References: <20230522110849.2921-1-urezki@gmail.com> <20230522110849.2921-5-urezki@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html 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_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 Tue, May 23, 2023 at 04:53:25PM +0200, Uladzislau Rezki wrote: > > > +#define fbl_lock(z, i) spin_lock(&fbl(z, i, lock)) > > > +#define fbl_unlock(z, i) spin_unlock(&fbl(z, i, lock)) > > > > Even if it is just temporary, I don't think adding these wrappers > > make much sense. > > > If open-coded, it looks like: > > spin_lock(&z->fbl[BUSY].lock); Give the fbl structure a name and you can have a local variable for it, which will make all this a lot more readable. And then unless there is a really good reason to iterate over this as an array just have three of these structs embedded named free, busy and lazy.