On Tue, Mar 22, 2016 at 8:06 PM, <kernelnewbies-request@kernelnewbies.org> wrote:
Send Kernelnewbies mailing list submissions to kernelnewbies@kernelnewbies.org
To subscribe or unsubscribe via the World Wide Web, visit http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies or, via email, send a message with subject or body 'help' to kernelnewbies-request@kernelnewbies.org
You can reach the person managing the list at kernelnewbies-owner@kernelnewbies.org
When replying, please edit your Subject line so it is more specific than "Re: Contents of Kernelnewbies digest..."
Today's Topics:
1. Re: Is it possible to turn off the gcc optimization when compiling kernel? (Hao Lee) 2. Re: kernel_thread() causes segfault (Shashank Khasare) 3. Re: Is it possible to turn off the gcc optimization when compiling kernel? (Nicholas Mc Guire) 4. Re: How to get object virtual address from a kernel core dump (Arun Sudhilal) 5. Re: Is it possible to turn off the gcc optimization when compiling kernel? (Hao Lee) 6. Re: kernel_thread() causes segfault (Manoj Nayak) 7. Re :Querry Regarding Memory Alignment (Manoj Nayak)
----------------------------------------------------------------------
Message: 1 Date: Tue, 22 Mar 2016 19:24:38 +0800 From: Hao Lee <haolee.swjtu@gmail.com> Subject: Re: Is it possible to turn off the gcc optimization when compiling kernel? To: kernelnewbies@kernelnewbies.org Cc: Nicholas Mc Guire <der.herr@hofr.at> Message-ID: <CA+PpKPm= eHxK5oj39r8nrT6XGA4qo6XKMNRcgcNCNdGQW_SPvw@mail.gmail.com> Content-Type: text/plain; charset=UTF-8
On Mon, Mar 21, 2016 at 5:51 PM, Nicholas Mc Guire <der.herr@hofr.at> wrote:
You can not turn it off in all functions as some need particluar optimization flags to comile at all, but you can pass individual CFLAGS per file via the Makefile
CFLAGS_target.o = -O0 or -flags-to-use
aswell as remove specific CFLAGS with
CFLAGS_REMOVE_target.o = -flags-to-remove
but if you want to debug the kernel it is most likely not a good idea to try and disable optimization as the code you then are debugging might not have that much to do with the final code once optimization is on again. So simply generate the .lst file of the target you are trying to debug e.g. for kernel/sched/core.c:
make kernel/sched/core.lst
and then use that .lst file to understand the output of gdb you are inspecting.
Thanks for your reply! Besides,I also find that use "gcc -c -Q -O1 --help=optimizers" can print the exact set of optimizations.
regards, Hao Lee
------------------------------
Message: 2 Date: Tue, 22 Mar 2016 16:51:44 +0530 From: Shashank Khasare <sskkernelnewbie@gmail.com> Subject: Re: kernel_thread() causes segfault To: kernelnewbies@kernelnewbies.org Message-ID: < CAGwMyOAxpQJjR9LRDLCp-ZLgHqKPcaLuJwDWyowBMsHHs5sjug@mail.gmail.com> Content-Type: text/plain; charset="utf-8"
I am trying to implement ideas mentioned in the following OSDI paper: L. Soares and M. Stumm. FlexSC: flexible system call scheduling with exception-less system calls. In Proc. OSDI, 2010.
http://www.cs.cmu.edu/~chensm/Big_Data_reading_group/papers/flexsc-osdi10.pd...
The paper propose a new mechanism for applications to make syscall. The brief idea is to have two types of threads 1) User thread 2) Kernel Thread. These two threads share same address space, file descriptor tables, parent pid etc. Whenever user thread wants to make syscall, it would post the information about syscall number & arguments to syscall in common shared page. User thread would then wait till the results are posted on shared page. The kernel thread reads the syscall arguments from shared page and writes the results to shared page. User thread consumes the results and continues execution. Since the kernel thread and user thread can be scheduled on different cpu cores, and user thread is ideally never executing kernel code and vice versa, one can expect gain in instruction per cycle for application, since the cache pollution is reduced to some extent*.*
So to implement this mechanism, it is important for the user and kernel thread to share address space, fd tables etc. kernel_thread() works fine with older kernels to achieve this task, but is no longer an option.
Is there of any mechanism for sharing fd tables as well? Please let me know.
Thanks a lot, Shashank