mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bob McElrath <bob+linux-kernel@mcelrath.org>
To: linux-kernel@vger.kernel.org
Subject: Work queues
Date: Mon, 7 Oct 2002 00:41:39 -0500	[thread overview]
Message-ID: <20021007054138.GC5991@draal.physics.wisc.edu> (raw)

[-- Attachment #1: Type: text/plain, Size: 1762 bytes --]

Bob McElrath [bob+linux-kernel@vger.kernel.org] wrote:
> If you give the [nvisr/0] process a negative priority, the stalls go
> away.  I just played through a level of Chromium BSU and it performed
> flawlessly (with the nvisr process at -20 priority).  With the latest bk
> tree there are also no oopses.

So it seems the way to do this is:

    my_workqueue = create_workqueue("mywork");
    if (!my_workqueue) {
        printk("Unable to create workqueue\n");
        return -EIO;
    }
    pri.sched_priority = 1; /* BM: any nonzero should do, is there any reason 
                               to chose a larger priority? */
    rc = security_ops->task_setscheduler(isr_workqueue->cpu_wq[0]->pid, SCHED_FIFO, &pri);
    if(rc < 0) {
        printk("Unable to set real-time priority for NV (err=%d)\n", rc);
    }

The above code doesn't work though because the struct workqueue_struct is
hidden away in workqueue.c, invisible to modules.  The line:
    isr_workqueue->cpu_wq[0]->pid
bombs because the struct is not defined (dereferencing pointer to incomplete
type).  Is there a better way to get the pid of a workqueue I just created?  Or
for that matter is there a better way to set the scheduler for a workqueue I
just created?  I imagine many drivers would want to do this...

I notice the sched_setscheduler system call is not available in any kernel
header.  What is the proper procedure for calling such a function from a
module?

Cheers,
-- Bob

Bob McElrath
Univ. of Wisconsin at Madison, Department of Physics

    "The purpose of separation of church and state is to keep forever from
    these shores the ceaseless strife that has soaked the soil of Europe in
    blood for centuries." -- James Madison

[-- Attachment #2: Type: application/pgp-signature, Size: 240 bytes --]

             reply	other threads:[~2002-10-07  5:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-07  5:41 Bob McElrath [this message]
     [not found] <20021006185412.GA3140@draal.physics.wisc.edu>
     [not found] ` <3DA0958A.9050809@drugphish.ch>
     [not found]   ` <20021006203142.GD10884@draal.physics.wisc.edu>
     [not found]     ` <20021006090255.GA13253@tapu.f00f.org>
     [not found]       ` <20021006212215.GA17790@tapu.f00f.org>
2002-10-07  3:18         ` nvidia 2.5.40+ patch? (& work queues) Bob McElrath
2002-10-07  5:38           ` Work queues Bob McElrath

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=20021007054138.GC5991@draal.physics.wisc.edu \
    --to=bob+linux-kernel@mcelrath.org \
    --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

all inboxes | Powered by JetHome®