[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200710084744.GA488397@jagdpanzerIV.localdomain>
Date: Fri, 10 Jul 2020 17:47:44 +0900
From: Sergey Senozhatsky <sergey.senozhatsky@...il.com>
To: Sergey Senozhatsky <sergey.senozhatsky@...il.com>
Cc: John Ogness <john.ogness@...utronix.de>,
Petr Mladek <pmladek@...e.com>,
Peter Zijlstra <peterz@...radead.org>,
Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>,
Steven Rostedt <rostedt@...dmis.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Andrea Parri <parri.andrea@...il.com>,
Thomas Gleixner <tglx@...utronix.de>,
Paul McKenney <paulmck@...nel.org>, kexec@...ts.infradead.org,
linux-kernel@...r.kernel.org
Subject: Re: [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
Powered by blists - more mailing lists