[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190215070614.GC2326@kadam>
Date: Fri, 15 Feb 2019 10:06:14 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: Hugo Lefeuvre <hle@....eu.com>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
devel@...verdev.osuosl.org, Todd Kjos <tkjos@...roid.com>,
Greg Hartman <ghartman@...gle.com>,
Alistair Strachan <astrachan@...gle.com>,
linux-kernel@...r.kernel.org,
Arve Hjønnevåg <arve@...roid.com>,
Joel Fernandes <joel@...lfernandes.org>,
Martijn Coenen <maco@...roid.com>,
Christian Brauner <christian@...uner.io>
Subject: Re: [PATCH] staging/android: use multiple futex wait queues
On Thu, Feb 14, 2019 at 06:34:59PM +0100, Hugo Lefeuvre wrote:
> @@ -402,6 +410,7 @@ static int handle_vsoc_cond_wait(struct file *filp, struct vsoc_cond_wait *arg)
> struct vsoc_region_data *data = vsoc_dev.regions_data + region_number;
> int ret = 0;
> struct vsoc_device_region *region_p = vsoc_region_from_filep(filp);
> + struct vsoc_futex_wait_queue_t *it, *wait_queue = NULL;
^^^^^^^^^^^^^^^^^
> atomic_t *address = NULL;
> ktime_t wake_time;
>
> @@ -415,10 +424,27 @@ static int handle_vsoc_cond_wait(struct file *filp, struct vsoc_cond_wait *arg)
> address = shm_off_to_virtual_addr(region_p->region_begin_offset +
> arg->offset);
>
> + /* Find wait queue corresponding to offset or create it */
> + spin_lock(&data->futex_wait_queue_lock);
> + list_for_each_entry(it, &data->futex_wait_queue_list, list) {
> + if (wait_queue->offset == arg->offset) {
^^^^^^^^^^^^^^^^^^
You meant "it->offset".
> + wait_queue = it;
> + break;
> + }
> + }
> +
> + if (!wait_queue) {
> + wait_queue = kmalloc(sizeof(*wait_queue), GFP_KERNEL);
> + wait_queue->offset = arg->offset;
> + init_waitqueue_head(&wait_queue->queue);
> + list_add(&wait_queue->list, &data->futex_wait_queue_list);
> + }
> + spin_unlock(&data->futex_wait_queue_lock);
regards,
dan carpenter
Powered by blists - more mailing lists