Hi John,

I will explain it here.

On Mon, Apr 8, 2013 at 10:45 PM, John Stultz <john.stu...@linaro.org> wrote:

> On 04/08/2013 09:59 AM, arun wrote:
>
>> improvement1:
>> Current code makes more readable messages to vanish as pull_len = len
>>
>
>
The current code fixes up the lapped readers by pulling read offset by
write_len as shown below

RM -> Readable message
len->Length of the message to be written
log buffer-> The 256K length logcat buffer


^r_off-------------<len>---------------------------^new r_off
|----<log
buffer>-------------------------------------------------|RM1||RM2||RM3||RM4||RM5|------------------------------------|
                                           ^w_off<-----len------->^new w_off

According to the above diagram new w_off falls somewhere between RM1;
fix_up_readers() pulls
the r_off by len and the new r_off goes beyond RM5; So if you pull like
this arbitrary number of
readable messages will be lost.

Ideally you should pull the r_off to RM2 right??

This can be achieved by subtracting (r_off - w_off) from len if r_off >
w_off

 if r_off < w_off
___
|                      |
|                    len1
|                      |
w_off               |
|
|
|
buffer
|
|
|
new w_off
|
r_off             |
|                  |
|                 len2
|                  |
____            |

In this case distance between r_off and w_off = len1 + len 2 = (total
buffer size - (w_off - r_off)

Now coming to the second improvement if we have fixed one offset like this
the same can be
applied to any reader who has lapped by the current write.

Please review it.

Regards,
Arun C

 This doesn't quite parse. I'd suggest expanding your description of the
> problem you're trying to solve here. And not just explaining what you're
> changing, but why.
>
> Also, I've not often seen patches sent to this list go anywhere, so I'd
> suggest you send these sorts of patches (that apply against mainline
> kernels) to lkml <linux-ker...@vger.kernel.org> cc'ing Greg KH <
> gre...@linuxfoundation.org> and Arve Hjønnevåg <a...@android.com> (and me
> if you feel like it).
>
> (And if you had a change that doesn't apply to mainline, I'd submit it to
> AOSP instead of here).
>
> thanks
> -john
>
>

-- 
-- 
unsubscribe: android-kernel+unsubscr...@googlegroups.com
website: http://groups.google.com/group/android-kernel
--- 
You received this message because you are subscribed to the Google Groups 
"Android Linux Kernel Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-kernel+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to