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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 79FCEC7EE2D for ; Tue, 23 May 2023 15:14:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237150AbjEWPOS (ORCPT ); Tue, 23 May 2023 11:14:18 -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 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.