I found the comment placement a little confusing:
/* If you use pcpui again, reread it, since you might have migrated */
+ disable_irq();
proc_restartcore();
}
Do you want the comment after the disable_irq()?
Do we need to use an atomic_read for stuff like this? How smart is our
compiler? Although I assume
the kthread is known to be locked at this point?
+static inline bool is_ktask(struct kthread *kthread)
+{
+ return kthread->flags & KTH_IS_KTASK;
+}
+
+ /* Pretend that we blocked while filing this page. This catches a lot of
+ * bugs. It does slightly slow down the kernel, but it's only when filling
+ * the page cache, and considering we are using a RAMFS, you shouldn't
+ * measure things that actually rely on KFS's performance. */
+ kthread_usleep(1000);
ah, hmm.
I guess this is ok as kfs is on its way out?
Pretty much LGTM otherwise. I can't claim to understand all the
implications, however :-)
On Tue, Dec 8, 2015 at 1:52 PM Barret Rhoden <[email protected]> wrote:
> I've got a bunch of bug fixes, mostly related to kthreads/ktask,
> switch_to, page fault handling, and disabling IRQs. Good times.
>
> In lieu of a full git send-email, here's the branch info. I'm trying
> to spare Ron's Gmail inbox until he can get a filter set up or
> something. =)
>
> Barret
>
>
> --------------
> The following changes since commit
> 495a723da7db40d18c933c0d9b979058b0d8ffa4:
>
> Use core_id_early() in kprof trace buffer print code (2015-12-08
> 16:32:42 -0500)
>
> are available in the git repository at:
>
> [email protected]:brho/akaros.git bughunt
>
> for you to fetch changes up to d2a3d92ffc934b794c33f2b8a94da4b8e08615f2:
>
> Put a 1ms delay in kfs_readpage() (2015-12-08 16:35:04 -0500)
>
> You can view them at:
> https://github.com/brho/akaros/compare/495a723da7db...d2a3d92ffc93
>
>
> ----------------------------------------------------------------
> Barret Rhoden (18):
> Fix lock debugging issue with page faults and IRQs
> Track ktasks with a flag instead of a bool
> Define a set of default flags for kthreads
> Use a kthread flag to save the address space
> Do not use the return value of switch_to
> Have switch_{to,back} use an opaque uintptr_t
> Allow ktasks to switch_to()
> Determine bufs with is_ktask in the VFS [1/2]
> Mark kthreads as ktasks for kernel I/O [2/2]
> Do not switch_to in plan9setup()
> Do not disable IRQs to protect cur_ctx
> x86: pair disable_irqs with enable_irqs
> x86: remove misconceptions about "sti" and halting
> Provide handle_page_fault_nofile()
> x86: clean up __handle_page_fault()
> Fix up user memory accesses during syscall aborts
> Allow syscall-less abortable CLEs
> Put a 1ms delay in kfs_readpage()
>
> kern/arch/x86/arch.h | 4 +-
> kern/arch/x86/trap.c | 109 +++++++++++++++++++++--------------------
> kern/include/kthread.h | 16 ++++++-
> kern/include/mm.h | 1 +
> kern/include/process.h | 4 +-
> kern/src/arsc.c | 2 +-
> kern/src/elf.c | 14 +++---
> kern/src/event.c | 6 ++-
> kern/src/kdebug.c | 2 +-
> kern/src/kfs.c | 6 +++
> kern/src/ktest/pb_ktests.c | 13 ++---
> kern/src/kthread.c | 117
> ++++++++++++++++++++++++++++++++++-----------
> kern/src/mm.c | 14 +++++-
> kern/src/ns/sysfile.c | 9 +---
> kern/src/process.c | 51 ++++++++++++--------
> kern/src/schedule.c | 6 ---
> kern/src/smp.c | 5 +-
> kern/src/syscall.c | 12 +----
> kern/src/trap.c | 15 +++---
> kern/src/ucq.c | 2 +-
> kern/src/umem.c | 8 ++--
> kern/src/vfs.c | 33 +++++--------
> 22 files changed, 267 insertions(+), 182 deletions(-)
>
> --
> You received this message because you are subscribed to the Google Groups
> "Akaros" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>
--
You received this message because you are subscribed to the Google Groups
"Akaros" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/d/optout.