lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 14 Feb 2023 15:34:21 +0100
From:   Christophe JAILLET <christophe.jaillet@...adoo.fr>
To:     Jason Gunthorpe <jgg@...pe.ca>
Cc:     Leon Romanovsky <leon@...nel.org>, linux-kernel@...r.kernel.org,
        kernel-janitors@...r.kernel.org, linux-rdma@...r.kernel.org
Subject: Re: [PATCH] RDMA/restrack: Reorder fields in 'struct
 rdma_restrack_entry'

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.


Do you want code such as:
static void rdma_restrack_attach_task(struct rdma_restrack_entry *res,
				      struct task_struct *task)
{
	if (WARN_ON_ONCE(!task))
		return;

	if (res->task)
		put_task_struct(res->task);
	get_task_struct(task);
	res->task = task;
	res->user = true;			<--------
}

to be changed with 0/1 instead of false/true?

Apparently gcc 11.3 is fine with using true with u8:1, but I don't find 
it really logical.

CJ

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ