Kernel Newbies archive on
 help / color / Atom feed
From: Martin Galvan <>
To: Bharath Vedartham <>
Subject: Re: Setting CPU affinity for current process on kernel module?
Date: Thu, 12 Sep 2019 11:03:20 -0300
Message-ID: <> (raw)
In-Reply-To: <20190912092618.GA5911@bharath12345-Inspiron-5559>

El jue., 12 sept. 2019 a las 6:26, Bharath Vedartham
(<>) escribió:
> Just to be clear, What do you mean by current process. Is it the process
> which is executing the kernel module? That would be a kernel thread I
> believe or do you want to be able to set the cpu affinity for any
> process given its PID?
> And are you looking at setting CPU affinity of kernel threads or user
> threads.

Sorry, I wasn't clear: I want to set the affinity of 'current', which
is a kernel thread.

El jue., 12 sept. 2019 a las 6:38, Piotr Figiel (<>) escribió:
> set_cpus_allowed_ptr() is exported, maybe this is what you're looking for?

Yes, that's exactly what I needed. Thanks! I actually ended up using
work_on_cpu, which fits my use case better.

Kernelnewbies mailing list

  reply index

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-11 18:52 Martin Galvan
2019-09-11 19:16 ` Bharath Vedartham
2019-09-11 19:19   ` Martin Galvan
2019-09-12  9:26     ` Bharath Vedartham
2019-09-12 14:03       ` Martin Galvan [this message]
2019-09-13  4:50         ` Greg KH
2019-09-13 12:43           ` Martin Galvan
2019-09-13 12:55             ` Greg KH
2019-09-13 12:56               ` Martin Galvan
2019-09-13 14:13                 ` Greg KH
2019-09-19  5:43                   ` R. Engür Pişirici

Reply instructions:

You may reply publically 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:

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

  git send-email \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Kernel Newbies archive on

Archives are clonable:
	git clone --mirror kernelnewbies/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 kernelnewbies kernelnewbies/ \
	public-inbox-index kernelnewbies

Newsgroup available over NNTP:

AGPL code for this site: git clone public-inbox