public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Russell King <rmk@arm.linux.org.uk>
To: Dipankar Sarma <dipankar@in.ibm.com>
Cc: Andi Kleen <ak@muc.de>, Greg KH <greg@kroah.com>,
	linux-kernel@vger.kernel.org
Subject: Re: Fixing the tty layer was Re: any chance of 2.6.0-test*?
Date: Mon, 13 Jan 2003 09:15:26 +0000	[thread overview]
Message-ID: <20030113091526.A12379@flint.arm.linux.org.uk> (raw)
In-Reply-To: <20030113081233.GA15525@in.ibm.com>; from dipankar@in.ibm.com on Mon, Jan 13, 2003 at 01:42:33PM +0530

On Mon, Jan 13, 2003 at 01:42:33PM +0530, Dipankar Sarma wrote:
> > The idea of the BKL was to protect the protect context code against
> > itself (code lock) and also the few global data structures that 
> > are only accessed from process context (like the tty drivers list)
> 
> In that case would it not be better to replace all BKLs by a single tty
> lock ?

No.  The tty layer relies on being able to safely reschedule with the
BKL held.  If you replace it with a "tty lock" you need to find all
those schedule() points throughout _every_ tty line discipline and
tty driver and release that lock.

Basically, the tty later was written upon the assumption that there
would be only _one_ thread of execution running tty code at any one
time, and we only reschedule when we explicitly want to (which was
the general kernel coding rule before we got spinlocks etc.)  Every
point where a reschedule is possible, state checks are (should be)
made to prevent races.

When analysing the tty layer, you have to think not "what data does
this protect" but "what code are we protecting".  Note that you must
apply the same approach towards what were the global-cli points.

I don't think its the BKL points you have to worry about; they've
stayed the same over many kernel versions.  The places that need
deeper consideration are where the global-cli was replaced with the
local-cli.  Obviously the latter is not a direct subsitute for the
former.

-- 
Russell King (rmk@arm.linux.org.uk)                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html


  reply	other threads:[~2003-01-13  9:06 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20030110165441$1a8a@gated-at.bofh.it>
     [not found] ` <20030110165505$38d9@gated-at.bofh.it>
2003-01-11 12:27   ` any chance of 2.6.0-test*? Andi Kleen
2003-01-11 13:01     ` Russell King
2003-01-11 13:13       ` Andi Kleen
2003-01-11 14:39     ` Alan Cox
2003-01-11 14:06       ` Andi Kleen
2003-01-11 15:31         ` Alan Cox
2003-01-11 15:25           ` Andi Kleen
2003-01-11 19:18             ` Alan Cox
2003-01-13  3:33               ` Paul Mackerras
2003-01-13 14:59                 ` Alan Cox
2003-01-13 18:36                   ` Benjamin Herrenschmidt
2003-01-14  2:32                   ` ide-cs problem (was Re: any chance of 2.6.0-test*?) Paul Mackerras
2003-01-19 16:05         ` any chance of 2.6.0-test*? Pavel Machek
     [not found]   ` <20030112094007$1647@gated-at.bofh.it>
2003-01-12  9:56     ` Fixing the tty layer was " Andi Kleen
2003-01-13  6:41       ` Dipankar Sarma
2003-01-13  7:25         ` Andi Kleen
2003-01-13  8:12           ` Dipankar Sarma
2003-01-13  9:15             ` Russell King [this message]
2003-01-13  9:36               ` Dipankar Sarma
2003-01-13  6:45       ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030113091526.A12379@flint.arm.linux.org.uk \
    --to=rmk@arm.linux.org.uk \
    --cc=ak@muc.de \
    --cc=dipankar@in.ibm.com \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox