[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAPXgP11SN7cx7NW0Jv46g+KAvFPo61Ptczochzy4Ub83bjHn1Q@mail.gmail.com>
Date: Fri, 28 Sep 2012 16:34:24 +0200
From: Kay Sievers <kay@...y.org>
To: Jan H. Schönherr <schnhrr@...tu-berlin.de>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] printk: drop ambiguous LOG_CONT flag
On Fri, Sep 28, 2012 at 10:25 AM, Jan H. Schönherr
<schnhrr@...tu-berlin.de> wrote:
>> If really, really everything passes through vprintk_emit()
>> then we could keep all info about the previous message
>> there and definitely decide whether the current message continues
>> the previous one.
>>
>> Then, we wouldn't need to track the previous flags everywhere.
>
> Here is a patch that does just that.
>
> Seems to work. And it makes the code easier to understand.
> A more detailed description is below.
> - if (!(lflags & LOG_NEWLINE)) {
> - /*
> - * Flush the conflicting buffer. An earlier newline was missing,
> - * or another task also prints continuation lines.
> - */
> - if (cont.len && (lflags & LOG_PREFIX || cont.owner != current))
> - cont_flush(LOG_NEWLINE);
> + cont_add(facility, level, lflags, dict, dictlen, text, text_len);
That fails the racing task test, and a cont user that was nicely
merged before is now all in separate records.
It seems, unconditionally using the cont buffer like in your patch,
for all incoming messages just makes the entire cont merge buffer
dance useless when it comes to races.
The current behaviour has the advantage, that non-cont users will not
race against a cont user (which is like 99.x% of the races I expect).
The cont buffer is currently only used when we expect a cont user,
non-cont users happening in the middle of a cont-print will not flush
the and disturb the cont buffer.
Thanks,
Kay
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists