Linux - KernelThis forum is for all discussion relating to the Linux kernel.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Is it the generic kernel you're using or there are vendor patches too? It seems to me that you may have something that depends on the size of task_struct and/or positions of the fields inside.
Thanks for reply.
Yes there are a lot of vendor patches to support hardware, fix compilation, support gcc 7 etc. But none of these patches touches 'task_struct', they even don't touch the linux/include/sched.h file.
The patches do also nothing with atomic_flags.
As test i added bit fields, thus 'unsigned long atomic_flags: 32;'.
That doesn't compile of course with the macro's, but the kernel boot.
Even creating a new member e.g. 'unsigned long test;' is no problem.
In the unpatched source code of the kernel(without vendor patches), there are other structures with 'unsigned long atomic_flags', so i assume that a conflict occurs?
I tried to make a dmesg with Putty via RS232, but i only get rubbish.
Anyway..It's not a big deal(i revert the 2 commits), but it's not how it should be.
Having multiple structures with atomic_flags shouldn't be an issue. However, you might have a good intuition about it creating the difference. Are you able to see any macros in the vendor patches that do redefine atomic_flags for example?
As I do not have access to the same sources as you, I can only guess what you have in the vendor patches.
General bug? Or indeed caused by the vendor patch(in that case probably 001-linux-dreambox-kernel.patch).
I tested my patch a few days, and no problems. So far so good.
This is a very good path. If you have a unsigned int atomic_flags:16 next to the other bitfields it doesn't change anything in the structure - the compiler will pack all the fields together.
I suspect that it might be linked to struct thread_struct thread; You may try to put it before and after. The big patch 001-dreambox includes a change in resume funcion assembly that is accessing certain offsets of this structure. If they move, the function may work incorrectly. You may test this theory out.
I did the test, and i figured out the 'struct task_cputime cputime_expires' field at line 1367 is the, let's say border.
So with this patch, the box doesn't boot(prior).
Code:
@@ -1364,6 +1362,8 @@ struct task_struct {
/* mm fault and swap info: this can arguably be seen as either mm-specific or thread-specific */
unsigned long min_flt, maj_flt;
+ unsigned long atomic_flags; /* Flags needing atomic access. */
struct task_cputime cputime_expires;
struct list_head cpu_timers[3];
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.