Re: [PATCH -mm] readahead: partial sendfile fix
From: Fengguang Wu
Date: Thu Mar 08 2007 - 05:26:29 EST
Ram Pai,
Sorry for the long delay, I was just back from the winter vacation.
On Mon, Feb 12, 2007 at 11:49:10AM -0800, Ram Pai wrote:
> The solution you proposed seems kludgy to me. If you determine that the
I dislike it, either.
> its a restarted aio, then start reading from where readahead had left
> reading from earlier. To me a simple fix is:
>
> - if (unlikely(aio_restarted()))
> - next_index = last_index; /* Avoid repeat readahead */
>
> + if (unlikely(aio_restarted()))
> + next_index = min(prev_index+1, last_index);
>
>
> No?
Can be even simpler, if we _only_ want to fix the aio case:
+ if (unlikely(aio_restarted()))
+ next_index = prev_index + 1;
Regards,
Wu
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/