Re: [PATCH] RDMA/restrack: Reorder fields in 'struct rdma_restrack_entry'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux