public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: liyu <liyu@ccoss.com.cn>
To: LKML <linux-kernel@vger.kernel.org>
Subject: [Question] I doublt on spin_lock again.
Date: Wed, 23 Nov 2005 10:04:56 +0800	[thread overview]
Message-ID: <4383CE48.60007@ccoss.com.cn> (raw)

Hi, All.

    I come here again.

    I have two questions on spin_lock. these are:

    1. I found these use spin_lock(&rq->lock) in set_user_nice(), but 
not disable interrput ( e.g.  when sys_nice() call it ),  if the one 
timer interrput come before we unlock the spin_lock, Shall
we dead lock here?  Since the scheduler_tick() may try to hold the same 
lock.

    2. I also found some function name in its definition have some 
postfix, I show here two classical examples:

static void double_rq_lock(runqueue_t *rq1, runqueue_t *rq2)
    __acquires(rq1->lock)
    __acquires(rq2->lock)
{ ... }

static void double_rq_unlock(runqueue_t *rq1, runqueue_t *rq2)
    __releases(rq1->lock)
    __releases(rq2->lock)
{ ... }

    In the related header files, they are defined as two preprocess 
macroes, are follow:

# define __acquires(x)    __attribute__((context(0,1)))
# define __releases(x)    __attribute__((context(1,0)))
# define __acquire(x)    __context__(1)
# define __release(x)    __context__(-1)


    I guess they are some extensions of gcc for C language, but I did 
not  found any information in GCC manual.

    Would you like reply these questions? Thank advanced.

-liyu










             reply	other threads:[~2005-11-23  2:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-23  2:04 liyu [this message]
2005-11-23  2:51 ` [Question] I doublt on spin_lock again Zhang Le
2005-11-23  2:56   ` liyu
2005-11-23  4:09     ` Zhang Le

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=4383CE48.60007@ccoss.com.cn \
    --to=liyu@ccoss.com.cn \
    --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