All of lore.kernel.org
 help / color / mirror / Atom feed
From: "David C. Hansen" <haveblue@us.ibm.com>
To: Linux kernel mailing list <linux-kernel@vger.kernel.org>
Subject: Big kernel lock in release functions
Date: Thu, 04 Oct 2001 10:14:31 -0700	[thread overview]
Message-ID: <3BBC98F7.F23A2D26@us.ibm.com> (raw)

  I've been looking at use of the big kernel lock in a lot of different
places in the kernel.  I've noticed that there are quite a few uses in
devices' release functions, with no obvious purpose.  Take a look at
arch/m68k/atari/joystick.c:

    lock_kernel();
    joystick[minor].active = 0;
    joystick[minor].ready = 0;

    if ((joystick[0].active == 0) && (joystick[1].active == 0))
        ikbd_joystick_disable();
    unlock_kernel();

  But, there are other places in the same file where the same operations
are performed with no locking at all (except for
ikbd_joystick_disable()). Is there a reason to have locking in the
release function but not in the read or open functions?  
  This is a quite common practice in release functions throughout the
kernel.  In 2.4.10, I counted 108 different places where the BKL is used
in a release function.  I'm not claiming that all of these are
unnecessary, but I believe a big chunk of them are.  

--
David C. Hansen
haveblue@us.ibm.com
IBM LTC Base/OS Group
(503)578-4080

                 reply	other threads:[~2001-10-04 17:14 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=3BBC98F7.F23A2D26@us.ibm.com \
    --to=haveblue@us.ibm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.