lkml.org 
[lkml]   [2020]   [Jul]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v5 2/4] printk: add lockless ringbuffer
On (20/07/10 17:43), Sergey Senozhatsky wrote:
> [..]
>
> > +void prb_init(struct printk_ringbuffer *rb,
> > + char *text_buf, unsigned int textbits,
> > + char *dict_buf, unsigned int dictbits,
> > + struct prb_desc *descs, unsigned int descbits)
> > +{
> > + memset(descs, 0, _DESCS_COUNT(descbits) * sizeof(descs[0]));
> > +
> > + rb->desc_ring.count_bits = descbits;
> > + rb->desc_ring.descs = descs;
> > + atomic_long_set(&rb->desc_ring.head_id, DESC0_ID(descbits));
> > + atomic_long_set(&rb->desc_ring.tail_id, DESC0_ID(descbits));
> > +
> > + rb->text_data_ring.size_bits = textbits;
> > + rb->text_data_ring.data = text_buf;
> > + atomic_long_set(&rb->text_data_ring.head_lpos, BLK0_LPOS(textbits));
> > + atomic_long_set(&rb->text_data_ring.tail_lpos, BLK0_LPOS(textbits));
> > +
> > + rb->dict_data_ring.size_bits = dictbits;
> > + rb->dict_data_ring.data = dict_buf;
> > + atomic_long_set(&rb->dict_data_ring.head_lpos, BLK0_LPOS(dictbits));
> > + atomic_long_set(&rb->dict_data_ring.tail_lpos, BLK0_LPOS(dictbits));
> > +
>
> Just a side note: some people want !CONFIG_PRINTK builds. I wonder
> how many people will want !CONFIG_PRINTK_DICT. The core logbuf/dict
> logbuf split is really cool.

We also may be can add a dedicated logbuf for the user-space logs,
as opposed to current "user space can write to the kernel logbuf".
Some folks really dislike that systemd, for instance, can trash
the core kernel logbuf doing a lot of /dev/kmsg writes.

-ss

\
 
 \ /
  Last update: 2020-07-10 10:48    [W:0.061 / U:2.208 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site