Skip to contentSkip to conversation

m68knommu: ColdFire add support for kernel preemption

PATCH In review Greg Ungerer 4 participants 11 messages May 1, 2008 – Jun 23, 2008 Linux-next tree

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 m68knommu: ColdFire add support for kernel preemption

From: Sebastian Siewior <[email protected]>

As the subject says this patch adds the support for kernel preemption on m68knommu Coldfire. I thing the same changes could be applied to 68360 & 68328 but since I don't have the HW for testing, I don't touch it.

---

arch/m68knommu/kernel/asm-offsets.c +1 -0
diff -Naurp linux-2.6.25/arch/m68knommu/kernel/asm-offsets.c linux-2.6.25-uc0/arch/m68knommu/kernel/asm-offsets.c
@@ -91,6 +91,7 @@ int main(void)
 	DEFINE(TI_TASK, offsetof(struct thread_info, task));
 	DEFINE(TI_EXECDOMAIN, offsetof(struct thread_info, exec_domain));
 	DEFINE(TI_FLAGS, offsetof(struct thread_info, flags));
+	DEFINE(TI_PREEMPTCOUNT, offsetof(struct thread_info, preempt_count));
 	DEFINE(TI_CPU, offsetof(struct thread_info, cpu));
 
 	return 0;
arch/m68knommu/platform/coldfire/entry.S +16 -0
diff -Naurp linux-2.6.25/arch/m68knommu/platform/coldfire/entry.S linux-2.6.25-uc0/arch/m68knommu/platform/coldfire/entry.S
@@ -106,6 +106,22 @@ ret_from_exception:
 	btst	#5,%sp@(PT_SR)		/* check if returning to kernel */
 	jeq	Luser_return		/* if so, skip resched, signals */
 
+#ifdef CONFIG_PREEMPT
+	movel	%sp,%d1			/* get thread_info pointer */
+	andl	#-THREAD_SIZE,%d1	/* at base of kernel stack */
+	movel	%d1,%a0
+	movel	%a0@(TI_FLAGS),%d1	/* get thread_info->flags */
+	andl	#_TIF_NEED_RESCHED,%d1
+	jeq	Lkernel_return
+
+	movel	%a0@(TI_PREEMPTCOUNT),%d1
+	cmpl	#0,%d1
+	jne	Lkernel_return
+
+	pea	Lkernel_return
+	jmp	preempt_schedule_irq	/* preempt the kernel */
+#endif
+
 Lkernel_return:
 	moveml	%sp@,%d1-%d5/%a0-%a2
 	lea	%sp@(32),%sp		/* space for 8 regs */
#1 lore raw
Quoted 1 line · On Thu, 1 May 2008 12:16:29 +1000 Greg Ungerer <[email protected]> wrote:

Subject: [PATCH] m68knommu: ColdFire add support for kernel preemption

Please find a way to get your patch queue into linux-next so that others get some visibility into what you're brewing earlier than last-day-of-the-merge-window?

Also, when emailing patches like this I do think that it's best that they be sequence-numbered, even if they are all non-overlapping and unrelated. Because it allows the recipient to check that none got lost.

Thanks.

#2 lore raw

Hi Andrew,

Quoted 8 lines · Andrew Morton
Quoted 1 line · On Thu, 1 May 2008 12:16:29 +1000 Greg Ungerer <[email protected]> wrote:

Subject: [PATCH] m68knommu: ColdFire add support for kernel preemption

Please find a way to get your patch queue into linux-next so that others get some visibility into what you're brewing earlier than last-day-of-the-merge-window?

Is a git tree the only way?

Quoted 2 lines

Also, when emailing patches like this I do think that it's best that they
be sequence-numbered, even if they are all non-overlapping and unrelated. Because it allows the recipient to check that none got lost.

Ok.

Regards
Greg

------------------------------------------------------------------------

Greg Ungerer  --  Chief Software Dude       EMAIL:     [email protected]
SnapGear -- a Secure Computing Company      PHONE:       +61 7 3435 2888
825 Stanley St,                             FAX:         +61 7 3891 3630
Woolloongabba, QLD, 4102, Australia         WEB: http://www.SnapGear.com
#3 lore raw
Quoted 1 line · * Greg Ungerer | 2008-05-02 17:19:22 [+1000]:

Hi Andrew,

Hi Greg,

Quoted 9 lines
Quoted 6 lines · Andrew Morton
Quoted 1 line · On Thu, 1 May 2008 12:16:29 +1000 Greg Ungerer <[email protected]> wrote:

Subject: [PATCH] m68knommu: ColdFire add support for kernel preemption

Please find a way to get your patch queue into linux-next so that others get some visibility into what you're brewing earlier than last-day-of-the-merge-window?

Is a git tree the only way?

Others (Greg KH for instance, i2c) have quilt queues.

Quoted 2 lines

Regards
Greg

Sebastian

#4 lore raw
Quoted 7 lines · On Fri, 2 May 2008 10:37:55 +0200 Sebastian Siewior <[email protected]>…
Quoted 6 lines
Quoted 4 lines
Quoted 1 line

Subject: [PATCH] m68knommu: ColdFire add support for kernel preemption

Please find a way to get your patch queue into linux-next so that others get some visibility into what you're brewing earlier than last-day-of-the-merge-window?

Is a git tree the only way?

Others (Greg KH for instance, i2c) have quilt queues.

Yup. Examples:

ftp://ftp.kernel.org/pub/linux/kernel/people/agk/patches/2.6/editing/
http://ozlabs.org/~rusty/kernel/rr-latest
http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/gregkh-02-usb

Note how you can publish subsets of your patchset by bracketing them with "# MM_PATCHES_START" and "# MM_PATCHES_END" for -mm, and "# NEXT_PATCHES_START" and "# NEXT_PATCHES_END" for linux-next.

#5 lore raw

Hi Andrew,

Quoted 11 lines · Andrew Morton
Quoted 6 lines · On Fri, 2 May 2008 10:37:55 +0200 Sebastian Siewior <[email protected]>…
Quoted 5 lines
Quoted 4 lines
Quoted 1 line

Subject: [PATCH] m68knommu: ColdFire add support for kernel preemption

Please find a way to get your patch queue into linux-next so that others get some visibility into what you're brewing earlier than last-day-of-the-merge-window?

Is a git tree the only way?

Others (Greg KH for instance, i2c) have quilt queues.

Yup. Examples:

Quoted 7 lines

ftp://ftp.kernel.org/pub/linux/kernel/people/agk/patches/2.6/editing/
http://ozlabs.org/~rusty/kernel/rr-latest
http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/gregkh-02-usb

Note how you can publish subsets of your patchset by bracketing them with "# MM_PATCHES_START" and "# MM_PATCHES_END" for -mm, and "# NEXT_PATCHES_START" and "# NEXT_PATCHES_END" for linux-next.

I decided to go the git route.

Here is a git tree for the collection of patches for the m68knommu architecture that I intend for the 2.6.27 merge window.

git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu.git for-linus

I have created a general uclinux changes git tree as well,

git://git.kernel.org/pub/scm/linux/kernel/git/gerg/uclinux.git for-linus

though currently I have nothing queued for that.

Regards
Greg

------------------------------------------------------------------------

Greg Ungerer  --  Chief Software Dude       EMAIL:     [email protected]
Secure Computing Corporation                PHONE:       +61 7 3435 2888
825 Stanley St,                             FAX:         +61 7 3891 3630
Woolloongabba, QLD, 4102, Australia         WEB: http://www.SnapGear.com
#6 lore raw
Quoted 27 lines · On Mon, 23 Jun 2008 15:32:53 +1000 Greg Ungerer <[email protected]> wrote:

Hi Andrew,

Quoted 11 lines · Andrew Morton
Quoted 6 lines · On Fri, 2 May 2008 10:37:55 +0200 Sebastian Siewior <[email protected]>…
Quoted 5 lines
Quoted 4 lines
Quoted 1 line

Subject: [PATCH] m68knommu: ColdFire add support for kernel preemption

Please find a way to get your patch queue into linux-next so that others get some visibility into what you're brewing earlier than last-day-of-the-merge-window?

Is a git tree the only way?

Others (Greg KH for instance, i2c) have quilt queues.

Yup. Examples:

Quoted 7 lines

ftp://ftp.kernel.org/pub/linux/kernel/people/agk/patches/2.6/editing/
http://ozlabs.org/~rusty/kernel/rr-latest
http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/gregkh-02-usb

Note how you can publish subsets of your patchset by bracketing them with "# MM_PATCHES_START" and "# MM_PATCHES_END" for -mm, and "# NEXT_PATCHES_START" and "# NEXT_PATCHES_END" for linux-next.

I decided to go the git route.

Here is a git tree for the collection of patches for the m68knommu architecture that I intend for the 2.6.27 merge window.

Quoted 8 lines

git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu.git for-linus

I have created a general uclinux changes git tree as well,

git://git.kernel.org/pub/scm/linux/kernel/git/gerg/uclinux.git for-linus

though currently I have nothing queued for that.

Great, thanks. But can we get them into linux-next please? I'll pick them up via that route.

#7 lore raw

Hi Greg,

Quoted 7 lines · On Sun, 22 Jun 2008 22:51:02 -0700 Andrew Morton <[email protected]>…
Quoted 4 lines · On Mon, 23 Jun 2008 15:32:53 +1000 Greg Ungerer <[email protected]> wrote:

Here is a git tree for the collection of patches for the m68knommu architecture that I intend for the 2.6.27 merge window.

git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu.git for-linus

Added today (slipped it in at the end).

Quoted 3 lines
Quoted 3 lines

I have created a general uclinux changes git tree as well,

git://git.kernel.org/pub/scm/linux/kernel/git/gerg/uclinux.git for-linus

This tree currently has no for-linus branch. You should create one (even if it just a subset of Linus' tree). I've added it using its master branch for now, please let me know when it is fixed.

Also, these branches would normally be called for-next. Most people keep for-linus for bug fixes for the current release. If you decide to change the branch name, just let me know.

Repeat of the rules for linux-next: anything included must have been posted somewhere appropriate, reviewed and unit tested (i.e. your tree should build for you).

Quoted 2 lines

Great, thanks. But can we get them into linux-next please? I'll pick them up via that route.

Done.

Signature · 3 lines
Cheers,
Stephen Rothwell                    [email protected]
http://www.canb.auug.org.au/~sfr/
#8 lore raw

Hi Stephen,

Quoted 11 lines · Stephen Rothwell

Hi Greg,

Quoted 6 lines · On Sun, 22 Jun 2008 22:51:02 -0700 Andrew Morton <[email protected]>…
Quoted 4 lines · On Mon, 23 Jun 2008 15:32:53 +1000 Greg Ungerer <[email protected]> wrote:

Here is a git tree for the collection of patches for the m68knommu architecture that I intend for the 2.6.27 merge window.

git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu.git for-linus

Added today (slipped it in at the end).

Great, thanks.

Quoted 7 lines
Quoted 3 lines
Quoted 3 lines

I have created a general uclinux changes git tree as well,

git://git.kernel.org/pub/scm/linux/kernel/git/gerg/uclinux.git for-linus

This tree currently has no for-linus branch. You should create one (even if it just a subset of Linus' tree). I've added it using its master branch for now, please let me know when it is fixed.

Ok, fixed now. There is an empty for-linus branch there.

Quoted 3 lines

Also, these branches would normally be called for-next. Most people keep for-linus for bug fixes for the current release. If you decide to change the branch name, just let me know.

Ok, done too. Branches named for-next exist in both. The patches on the for-linus branch in the m68knommu.git are now on the for-next branch.

Do I need to send a request to Linus to pull this into his tree during the next merge window? Or will it migrate up from linux-next?

Quoted 8 lines

Repeat of the rules for linux-next: anything included must have been posted somewhere appropriate, reviewed and unit tested (i.e. your tree should build for you).

Quoted 2 lines

Great, thanks. But can we get them into linux-next please? I'll pick them up via that route.

Done.

Thanks
Greg

------------------------------------------------------------------------

Greg Ungerer  --  Chief Software Dude       EMAIL:     [email protected]
SnapGear -- a Secure Computing Company      PHONE:       +61 7 3435 2888
825 Stanley St,                             FAX:         +61 7 3891 3630
Woolloongabba, QLD, 4102, Australia         WEB: http://www.SnapGear.com
#9 lore raw
Quoted 2 lines · On Mon, 23 Jun 2008 23:23:08 +1000 Greg Ungerer <[email protected]> wrote:

Do I need to send a request to Linus to pull this into his tree during the next merge window?

Yes, you do - nothing has changed in that regard.

Quoted 2 lines

Or will it migrate up
from linux-next?

Nope, linux-next is a testing tree only.

#10 lore raw
In reply to Greg Ungerer

Hi Greg,

Quoted 4 lines · On Mon, 23 Jun 2008 23:23:08 +1000 Greg Ungerer <[email protected]> wrote:

Ok, done too. Branches named for-next exist in both. The patches on the for-linus branch in the m68knommu.git are now on the for-next branch.

I have updated my info, thanks.

Quoted 3 lines

Do I need to send a request to Linus to pull this into his tree during the next merge window? Or will it migrate up from linux-next?

Andrew has answered these.

Signature · 3 lines
Cheers,
Stephen Rothwell                    [email protected]
http://www.canb.auug.org.au/~sfr/