Re: [PATCH v2 5/7][next] printk: ringbuffer: add finalization/extension support

2020-08-28 Thread John Ogness
On 2020-08-28, Petr Mladek wrote: >> Below is a patch against this series that adds support for finalizing >> all 4 queried states. It passes all my tests. Note that the code handles >> 2 corner cases: >> >> 1. When seq is 0, there is no previous descriptor to finalize. This >>exception is im

Re: [PATCH v2 5/7][next] printk: ringbuffer: add finalization/extension support

2020-08-28 Thread Petr Mladek
On Thu 2020-08-27 12:04:58, John Ogness wrote: > On 2020-08-26, Petr Mladek wrote: > >> This series makes a very naive assumption that the previous > >> descriptor is either in the reserved or committed queried states. The > >> fact is, it can be in any of the 4 queried states. Adding support for

Re: [PATCH v2 5/7][next] printk: ringbuffer: add finalization/extension support

2020-08-27 Thread Petr Mladek
On Thu 2020-08-27 12:04:58, John Ogness wrote: > On 2020-08-26, Petr Mladek wrote: > >> This series makes a very naive assumption that the previous > >> descriptor is either in the reserved or committed queried states. The > >> fact is, it can be in any of the 4 queried states. Adding support for

Re: [PATCH v2 5/7][next] printk: ringbuffer: add finalization/extension support

2020-08-27 Thread John Ogness
Hi Petr, Thanks for the review. Most of your suggested changes are fine and I'll integrate them for the next version. Here a few comments on some open issues. On 2020-08-27, Petr Mladek wrote: >> +static struct prb_desc *desc_reopen_last(struct prb_desc_ring *desc_ring, >> +

Re: [PATCH v2 5/7][next] printk: ringbuffer: add finalization/extension support

2020-08-27 Thread Petr Mladek
Hi, this mail is based on my review that I did last two days. I haven't seen the last code that tried to handle the finalize issues. Anyway, this feedback might give some clueue as well. IMPORTANT: It seems that we both had different understanding of the DESC_FINAL_MASK behavior. It might explain

Re: [PATCH v2 5/7][next] printk: ringbuffer: add finalization/extension support

2020-08-27 Thread John Ogness
On 2020-08-26, Petr Mladek wrote: >> This series makes a very naive assumption that the previous >> descriptor is either in the reserved or committed queried states. The >> fact is, it can be in any of the 4 queried states. Adding support for >> finalization of all the states then gets quite compl

Re: [PATCH v2 5/7][next] printk: ringbuffer: add finalization/extension support

2020-08-26 Thread Petr Mladek
On Wed 2020-08-26 14:43:22, John Ogness wrote: > On 2020-08-26, Sergey Senozhatsky wrote: > >>> @@ -1157,6 +1431,14 @@ bool prb_reserve(struct prb_reserved_entry *e, > >>> struct printk_ringbuffer *rb, > >>> goto fail; > >>> } > >>> > >>> + /* > >>> + * New data is about to be rese

Re: [PATCH v2 5/7][next] printk: ringbuffer: add finalization/extension support

2020-08-26 Thread John Ogness
On 2020-08-26, Sergey Senozhatsky wrote: >>> @@ -1157,6 +1431,14 @@ bool prb_reserve(struct prb_reserved_entry *e, >>> struct printk_ringbuffer *rb, >>> goto fail; >>> } >>> >>> + /* >>> +* New data is about to be reserved. Once that happens, previous >>> +* descriptor

Re: [PATCH v2 5/7][next] printk: ringbuffer: add finalization/extension support

2020-08-26 Thread Sergey Senozhatsky
On (20/08/26 10:45), John Ogness wrote: > On 2020-08-24, John Ogness wrote: > > @@ -1157,6 +1431,14 @@ bool prb_reserve(struct prb_reserved_entry *e, > > struct printk_ringbuffer *rb, > > goto fail; > > } > > > > + /* > > +* New data is about to be reserved. Once that happ

Re: [PATCH v2 5/7][next] printk: ringbuffer: add finalization/extension support

2020-08-26 Thread John Ogness
On 2020-08-24, John Ogness wrote: > @@ -1157,6 +1431,14 @@ bool prb_reserve(struct prb_reserved_entry *e, struct > printk_ringbuffer *rb, > goto fail; > } > > + /* > + * New data is about to be reserved. Once that happens, previous > + * descriptors are no long

[PATCH v2 5/7][next] printk: ringbuffer: add finalization/extension support

2020-08-24 Thread John Ogness
Add support for extending the last data block. For this, introduce a new finalization state flag that identifies if a descriptor may be extended. When a writer calls the commit function prb_commit(), the record may still continue to be in the reserved queried state. In order for that record to ent