Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1694401

Re: [PATCH 2/2] printk/console: Enhance the check for consoles using init memory

Path csiph.com!news.redatomik.org!aioe.org!bofh.it!news.nic.it!robomod
From Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH 2/2] printk/console: Enhance the check for consoles using init memory
Date Mon, 24 Jul 2017 04:10:03 +0200
Message-ID <u6AYP-6ZP-11@gated-at.bofh.it> (permalink)
References <u38mm-3Ag-9@gated-at.bofh.it> <u38mm-3Ag-31@gated-at.bofh.it> <u3gWB-1b1-11@gated-at.bofh.it> <u5HfY-5Zt-15@gated-at.bofh.it>
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=VnBPv+uj7VdWxwcJKf9INdxpH8EuQucIO7hycijMLIY=; b=PC9/P3C/d17alCr+pjhlgxgyuA+4R3fyYRt/i+p8Ifd74vqfE/JQ0py9pgQzcAwdgz g0qxsyPguA0pL/PPhxe7CAR4fU63DyfaFguDweLtBPmLdYHGB4E3O6Tn5jxAG+7BjdZ3 4dyJnjCDi9oaXj39Oo1mFk0xMeFGdJxGD2x6GzEEMCxJqHwn+k/nlhLPTAEkyf2xIn0j 5Mmp7grCS07Z9ekaNBwFbyeTj5YsSr5bk/o7GoCeHu98ebjThqeZJUq8WK92Tf/nmA0Q 2wZIA3/s5I9+SVwEiPuUKU6C4G/8nagJ2/BRswqxhNPaRW9OzjHTB8qjkyesh81fbA0R d3HQ==
X-Google-Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=VnBPv+uj7VdWxwcJKf9INdxpH8EuQucIO7hycijMLIY=; b=k+1KRweTZHK6EdqI0Y0Li15VU2ag+9dLTI0vY3VQVJFiog+TnpqxnaqDnIoBwIXCim 9dzS+Zk5z1yxc2O/nG1mRo3GLSbC0yeQIIvadGwg7jm1w1wH6Caym6tUv686zmoB/NTL P1XrtH5olF0IINOguWBCaCDfoW8uID86QDZREkd51bWwi5PGMpEtBKIFMZ7MvIFkz8kn DZBmSg96QUUcv7bTeJglqT2d5kJycFOuZT3VsefRZlEPptknojAej2wWvcwUZzuqhmKO q+6Tiu91HUtyXyATjMTN0Zq7iKrKzW6/D4R5cgFY21sCzxDvKsz105cz7oLLwWrx9BY8 r8Ow==
X-Gm-Message-State AIVw1126s79ECsByFMqpmfzAWSaIddX4WkUNa4iolNMtucnd/0oQ5UHK Ip7cI9xbHT22fw==
X-Received by 10.84.228.200 with SMTP id y8mr16106099pli.102.1500861825266; Sun, 23 Jul 2017 19:03:45 -0700 (PDT)
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Disposition inline
User-Agent Mutt/1.8.3 (2017-05-23)
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 66
Organization linux.* mail to news gateway
X-Original-Cc Sergey Senozhatsky <sergey.senozhatsky@gmail.com>, Steven Rostedt <rostedt@goodmis.org>, Andrew Morton <akpm@linux-foundation.org>, Peter Zijlstra <peterz@infradead.org>, Matt Redfearn <matt.redfearn@imgtec.com>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Jiri Slaby <jslaby@suse.com>, "David S. Miller" <davem@davemloft.net>, Alan Cox <gnomes@lxorguk.ukuu.org.uk>, "Fabio M. Di Nitto" <fdinitto@redhat.com>, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
X-Original-Date Mon, 24 Jul 2017 11:03:56 +0900
X-Original-Message-ID <20170724020356.GA515@jagdpanzerIV.localdomain>
X-Original-References <1500036673-7122-1-git-send-email-pmladek@suse.com> <1500036673-7122-3-git-send-email-pmladek@suse.com> <20170714220626.GB10437@tigerII.localdomain> <20170721143253.GA26877@pathway.suse.cz>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1694401

Show key headers only | View raw


Hello,

On (07/21/17 16:32), Petr Mladek wrote:
[..]
> > sort of a problem here is that the next time anyone adds a new ->foo()
> > callback to struct console, that person also needs to remember to update
> > printk_late_init().
> 
> I am not super happy with this as well. Any hint how to do it better
> or more secure is welcome. But I do not see a beter solution at the moment.
> 
> Note that there are only 3 commits in the git history that change this
> structure. Neither of them invalidates this check!

well, the console output is far from perfect, so I can imagine future
changes ;)

> > a completely crazy idea,
> > can we have a dedicated "console init" section which we will not offload
> > if we see keep_bootcon?
> 
> I though about this as well. But this will not avoid the above
> problem. We still would need to make sure that the consoles
> use the special section. Or do I miss anything?

you don't miss anything.

to fix the rootcause of the problem, and not its aftershock, we still
need to either:
	a) move consoles to normal section
or
	b) move consoles to a special section

I don't mind that warning, but I think we also need to tweak the
affected consoles. otherwise, upon maintainer's request to keep
bootcon, a user can just report back "uses init memory and must
be disabled even before the real one is ready" warning, yet the
kernel still would crash (a theoretical case, but for some reason
someone wanted to keep bootcon after all).

[..]
> It means that less than 25% of early consoles are located in the init
> code. I am not sure if it is worth introducing a new section.

ok, good.

> Instead it would make sense to move all these consoles into the normal
> section. But it is not strictly needed if the normal console is
> registered using an init call (always in time). In this case, it is "enough"
> to mention the real console as the last one on the command line.

let's move. to normal section, or to special section. depending on how
much space we can saved unloading the consoles.

> > or... even crazier... disable bootmem offloading (do not offload init
> > section) at all if we see keep_bootcon? keep_bootcon is a purely debugging
> > option which people enable when things are bad and unclear, no one should
> > be using it otherwise, so may be that idea can be a way to go.
> 
> I have talked about this with my colleagues. They told me that it
> would be pity. The keep_bootcon option might be useful to debug
> problems related to freeing the init memory.

agree.

	-ss

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH 2/2] printk/console: Enhance the check for consoles using  init memory Petr Mladek <pmladek@suse.com> - 2017-07-21 16:40 +0200
  Re: [PATCH 2/2] printk/console: Enhance the check for consoles using  init memory Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2017-07-24 04:10 +0200
    Re: [PATCH 2/2] printk/console: Enhance the check for consoles using  init memory Petr Mladek <pmladek@suse.com> - 2017-07-27 11:30 +0200
      Re: [PATCH 2/2] printk/console: Enhance the check for consoles using  init memory Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2017-07-27 12:00 +0200

csiph-web