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 6FA2DC6379F for ; Mon, 20 Feb 2023 22:16:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232022AbjBTWQo (ORCPT ); Mon, 20 Feb 2023 17:16:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229885AbjBTWQm (ORCPT ); Mon, 20 Feb 2023 17:16:42 -0500 Received: from smtp.smtpout.orange.fr (smtp-29.smtpout.orange.fr [80.12.242.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D557B1ABF5 for ; Mon, 20 Feb 2023 14:16:37 -0800 (PST) Received: from [192.168.1.18] ([86.243.2.178]) by smtp.orange.fr with ESMTPA id UESYpyOTplrplUESYpdBva; Mon, 20 Feb 2023 23:16:35 +0100 X-ME-Helo: [192.168.1.18] X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Mon, 20 Feb 2023 23:16:35 +0100 X-ME-IP: 86.243.2.178 Message-ID: Date: Mon, 20 Feb 2023 23:16:34 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: [PATCH] RDMA/restrack: Reorder fields in 'struct rdma_restrack_entry' To: Jason Gunthorpe Cc: Leon Romanovsky , linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, linux-rdma@vger.kernel.org References: <75480cf9-8d06-7a7d-4624-6ddbb7d6053a@wanadoo.fr> Content-Language: fr, en-US From: Christophe JAILLET In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 15/02/2023 à 12:31, Leon Romanovsky a écrit : > On Tue, Feb 14, 2023 at 11:01:00AM -0400, Jason Gunthorpe wrote: >> On Tue, Feb 14, 2023 at 03:34:21PM +0100, Christophe JAILLET wrote: >>> Le 14/02/2023 à 14:08, Jason Gunthorpe a écrit : >>>> On Tue, Feb 14, 2023 at 01:53:52PM +0100, Christophe JAILLET wrote: >>>>> diff --git a/include/rdma/restrack.h b/include/rdma/restrack.h >>>>> index 8b7c46daeb07..da53fefe6f9e 100644 >>>>> --- a/include/rdma/restrack.h >>>>> +++ b/include/rdma/restrack.h >>>>> @@ -80,6 +80,10 @@ struct rdma_restrack_entry { >>>>> * query stage. >>>>> */ >>>>> u8 no_track : 1; >>>>> + /** >>>>> + * @user: user resource >>>>> + */ >>>>> + bool user; >>>> >>>> Can we combine this into the bitfield above? >>>> >>>> Jason >>>> >>> Hi, >>> >>> and even above, we have >>> bool valid; >>> >>> I wanted to keep the changes as minimal as possible, but I can change them >>> all in a single bitfield. >> >> IIRC it needs to be checked, I vaugely remember valid can't be a >> bitfield because it is an atomic > > I don't remember anything like this. > > Thanks > If I understand code correctly, 'valid' is only used in rdma_restrack_add() and rdma_restrack_del(). I don't think that any atomic behavior is in place in these functions. I'll send in the coming days a v2 which changes 'valid', 'no_track' and 'user' as bool:1. CJ