public inbox for linux-m68k@lists.linux-m68k.org
 help / color / mirror / Atom feed
From: Michael Schmitz <schmitzmic@gmail.com>
To: Finn Thain <fthain@linux-m68k.org>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>,
	linux-m68k@lists.linux-m68k.org
Subject: Re: [PATCH RFC] m68k: skip kernel premption if interrupts were disabled
Date: Tue, 26 Mar 2024 11:31:57 +1300	[thread overview]
Message-ID: <597ab0b3-ac1d-443c-95f7-4f1bbcccae1f@gmail.com> (raw)
In-Reply-To: <acd34add-27af-24a5-9af5-d40cab71c651@linux-m68k.org>

Hi Finn,

see below (hopefully not whitespace-damaged).

The set_fc warning is specific to 040 but the bad kernel buserror (null 
pointer) causing it isn't. But testing on 030 would be a good idea if 
you have one with enough RAM. Haven't tried to boot my Falcon with a 
preempt enabled kernel yet.

Cheers,

     Michael


diff --git a/arch/m68k/mm/motorola.c b/arch/m68k/mm/motorola.c
index 4d4d390a2df2..96cdcacb94ea 100644
--- a/arch/m68k/mm/motorola.c
+++ b/arch/m68k/mm/motorola.c
@@ -15,6 +15,7 @@
  #include <linux/mm.h>
  #include <linux/swap.h>
  #include <linux/kernel.h>
+#include <linux/preempt.h>
  #include <linux/string.h>
  #include <linux/types.h>
  #include <linux/init.h>
@@ -195,6 +196,8 @@ int free_pointer_table(void *table, int type)
         unsigned long page = ptable & PAGE_MASK;
         unsigned int mask = 1U << ((ptable - page)/ptable_size(type));

+       preempt_disable();
+
         dp = PD_PTABLE(page);
         if (PD_MARKBITS (dp) & mask) {
                 pr_err("saved from last preempt: nr %x sr %lx %x pc %lx 
sp %lx\n",
@@ -213,6 +216,7 @@ int free_pointer_table(void *table, int type)
                 if (type == TABLE_PTE)
                         pagetable_pte_dtor(virt_to_ptdesc((void *)page));
                 free_page (page);
+               sched_preempt_enable_no_resched();
                 return 1;
         } else if (ptable_list[type].next != dp) {
                 /*
@@ -221,6 +225,7 @@ int free_pointer_table(void *table, int type)
                  */
                 list_move(dp, &ptable_list[type]);
         }
+       sched_preempt_enable_no_resched();
         return 0;
  }


On 26/03/24 11:28, Finn Thain wrote:
> On Mon, 25 Mar 2024, Michael Schmitz wrote:
>
>> Unfortunately, when I add preempt_disable()/
>> sched_preempt_enable_noresched() in free_pointer_table(), I don't get
>> that particular panic() anymore,
> I'd like to try that patch. Would you send it please?
>
>> but the bad kernel buserror with the warning from set_fc() that you
>> reported...
> I think those set_fc() calls are confined to 68040 fault handling. Maybe
> we should try running stress tests on a 68030?

  reply	other threads:[~2024-03-25 22:32 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-22  1:48 [PATCH RFC] m68k: skip kernel premption if interrupts were disabled Michael Schmitz
     [not found] ` <fcabda73-4b16-ee2c-e993-2bfcf392a26a@linux-m68k.org>
     [not found]   ` <e89bf618-2fa8-7cbd-16ed-d021a9a7f740@gmail.com>
     [not found]     ` <948c12e4-e85f-a86c-ae95-a1eb03ca026d@gmail.com>
     [not found]       ` <40928e38-0de7-75a6-d5f7-8c913155da03@linux-m68k.org>
2024-03-23  6:32         ` Michael Schmitz
2024-03-25  6:41           ` Michael Schmitz
2024-03-25 22:28             ` Finn Thain
2024-03-25 22:31               ` Michael Schmitz [this message]
2024-03-26  0:41                 ` Finn Thain
2024-03-26  9:58                 ` Finn Thain
2024-03-26 19:59                   ` Michael Schmitz
2024-03-26 22:03                     ` Finn Thain
2024-03-26 22:35                       ` Michael Schmitz
2024-03-27  3:50                         ` Finn Thain
2024-03-27  6:56                           ` Michael Schmitz
2024-03-27 23:29                             ` Spinlock debug, was " Finn Thain
     [not found]                               ` <7aee9fd9-1c0e-4874-bb86-e512a7c0caa6@gmail.com>
2024-03-28  2:48                                 ` Finn Thain
2024-03-28 19:54                                   ` Michael Schmitz
2024-03-30  2:46                                     ` Michael Schmitz
2024-03-30  6:23                                       ` Finn Thain
2024-03-31  6:14                                         ` Michael Schmitz
2024-03-27  8:38                           ` Finn Thain
2024-03-27 22:59                             ` Michael Schmitz
2024-03-27  8:22                     ` Geert Uytterhoeven

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=597ab0b3-ac1d-443c-95f7-4f1bbcccae1f@gmail.com \
    --to=schmitzmic@gmail.com \
    --cc=fthain@linux-m68k.org \
    --cc=geert@linux-m68k.org \
    --cc=linux-m68k@lists.linux-m68k.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