lkml.org 
[lkml]   [2006]   [May]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/6] nfs: "open code" the NFS direct write rescheduler
Andrew Morton wrote:
> Chuck Lever <cel@netapp.com> wrote:
>> + * Prevent I/O completion while we're still rescheduling
>> + */
>> + dreq->outstanding++;
>> +
>
> No locking.
>
>> dreq->count = 0;
>> + list_for_each(pos, &dreq->rewrite_list) {
>> + struct nfs_write_data *data =
>> + list_entry(dreq->rewrite_list.next, struct nfs_write_data, pages);
>> +
>> + spin_lock(&dreq->lock);
>> + dreq->outstanding++;
>> + spin_unlock(&dreq->lock);
>
> Locking.
>
> Deliberate?

Yes. At the top of the loop, there is no outstanding I/O, so no locking
is needed while updating "outstanding." Inside the loop, we've
dispatched some I/O against "dreq" so locking is needed to ensure
outstanding is updated properly.

--
corporate: cel at netapp dot com
personal: chucklever at bigfoot dot com
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-05-19 20:39    [W:0.042 / U:0.496 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site