Re: Call Trace analysis doubt

2016-06-20 Thread Augusto Mecking Caringi
On Wed, Jun 15, 2016 at 3:26 AM, Muni Sekhar  wrote:
> Hi,
>
> Let’s assume WARNING message says something like:
>
>
> [0.00] Call Trace:
>
> [0.00]  [] dump_stack+0x45/0x56
>
> [0.00]  [] warn_slowpath_common+0x7d/0xa0
>
> [0.00]  [] warn_slowpath_fmt_taint+0x44/0x50
>
> [0.00]  [] ? acpi_tb_acquire_table+0x3e/0x6c
>
> [0.00]  [] warn_invalid_dmar+0x81/0x93
>
> [0.00]  [] detect_intel_iommu+0xe9/0x172
>
> [0.00]  [] pci_iommu_alloc+0x4a/0x6c
>
> [0.00]  [] mem_init+0x17/0x9c
>
> [0.00]  [] start_kernel+0x23b/0x47d
>
> [0.00]  [] ? set_init_arg+0x53/0x53
>
> [0.00]  [] ? early_idt_handlers+0x120/0x120
>
> [0.00]  [] x86_64_start_reservations+0x2a/0x2c
>
> [0.00]  [] x86_64_start_kernel+0x143/0x152
>
> [0.00] ---[ end trace c32c0e307381ad8a ]---
>
>
>
> Few symbols in the above mentioned call trace are prefixed with “?”
> (for e.g.  ?early_idt_handlers\? set_init_arg\?
> acpi_tb_acquire_table), what does it mean?
> Does it needs to be considered while debugging the kernel module?

Hi,

There is an explanation about the meaning of these '?' here:

https://www.kernel.org/doc/Documentation/x86/kernel-stacks

-- 
Augusto Mecking Caringi

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Call Trace analysis doubt

2016-06-20 Thread Mulyadi Santosa
On Wed, Jun 15, 2016 at 1:26 PM, Muni Sekhar 
wrote:

> Hi,
>
> Let’s assume WARNING message says something like:
>
>
> [0.00] Call Trace:
>
> [0.00]  [] dump_stack+0x45/0x56
>
> [0.00]  [] warn_slowpath_common+0x7d/0xa0
>
> [0.00]  [] warn_slowpath_fmt_taint+0x44/0x50
>
> [0.00]  [] ? acpi_tb_acquire_table+0x3e/0x6c
>
> [0.00]  [] warn_invalid_dmar+0x81/0x93
>
> [0.00]  [] detect_intel_iommu+0xe9/0x172
>
> [0.00]  [] pci_iommu_alloc+0x4a/0x6c
>
> [0.00]  [] mem_init+0x17/0x9c
>
> [0.00]  [] start_kernel+0x23b/0x47d
>
> [0.00]  [] ? set_init_arg+0x53/0x53
>
> [0.00]  [] ? early_idt_handlers+0x120/0x120
>
> [0.00]  [] x86_64_start_reservations+0x2a/0x2c
>
> [0.00]  [] x86_64_start_kernel+0x143/0x152
>
> [0.00] ---[ end trace c32c0e307381ad8a ]---
>
>
>
> Few symbols in the above mentioned call trace are prefixed with “?”
> (for e.g.  ?early_idt_handlers\? set_init_arg\?
> acpi_tb_acquire_table), what does it mean?
> Does it needs to be considered while debugging the kernel module?
>
>
>
> Call Trace shows “function+0xoffset/0xlength”. Does the
> 0xoffset/0xlength changes if the module is built with –g option and
> without –g option?
>
>
> Thanks in Advance,
>
> --
> Thanks,
> Sekhar
>
>
Hi...

Not sure about the "?".

But about the offset/length, I think it will differ, but mostly because -g
implies turning off certain optimization options.



> ___
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>



-- 
regards,

Mulyadi Santosa
Freelance Linux trainer and consultant

blog: the-hydra.blogspot.com
training: mulyaditraining.blogspot.com
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: What is the point of this function?

2016-06-20 Thread Nathan Williams
On Tue, 2016-06-21 at 00:48 +0200, Andrea Benelli wrote:
> Hello, i was looking at the linux/sched.h (kernel version 4.6.2)
> source code and i found this function at line 1174: 
> 
> static inline bool cpus_share_cache(int this_cpu, int that_cpu)
> {
> return true;
> }
> 
> I'm not able to understand the utility of a function that just return
> a true value. 
> i've noticed that there are a lot of functions like this (function
> that just return a constant). 

Hi Andrea,

That's the case for when CONFIG_SMP isn't defined. What happens when
CONFIG_SMP is defined?

I suggest having a look through the code with a Linux cross reference:

http://lxr.free-electrons.com/ident?v=4.6;i=cpus_share_cache

Regards,
Nathan


___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: boot param to change tick

2016-06-20 Thread Augusto Mecking Caringi
On Sun, May 29, 2016 at 11:51 PM, Lax Clarke  wrote:
> Is there a way to change a grub/lilo kernel boot param to change the kernel
> tick rate?

AFAIK, no.

You have to rebuild the kernel to change the HZ value.

-- 
Augusto Mecking Caringi

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


What is the point of this function?

2016-06-20 Thread Andrea Benelli
Hello, i was looking at the *linux/sched.h* (kernel version 4.6.2) source
code and i found this function at line *1174*:

static inline bool cpus_share_cache(int this_cpu, int that_cpu)
{
return true;
}

I'm not able to understand the utility of a function that just return a
true value.
i've noticed that there are a lot of functions like this (function that
just return a constant).

so...why?
thanks.
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Netlink Socket: trouble while using netlink_broadcast

2016-06-20 Thread silky
Did this work?
Can you give me a working solution for this?


___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


looking for tutorials

2016-06-20 Thread ty armour
I need tutorials on kernel development. And on complete operating system
development. I would prefer them to be in assembly because it is faster,
but it seriously needs to get done.

If you are interested, simply post all of the tutorials and other relevant
information to coding kernels that you can

and show the references, like actually say okay so in order to do this we
need to look for this in the assembler manual.

Thanks and have fun
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Doubt regarding clk_prepare / clk_enable

2016-06-20 Thread Shubhrajyoti Datta
hi ,

I have a doubt about the clk_prepare vs clk_enable.
Currently I see all the users of clk_enable from process context in my platform.

There is a bit to write to enable the clocks since clk_enable cannot  sleep
spinlocks are used.

I was thinking since  there is no users can the spinlocks be replaced with
mutex and the function of enabled  be assigned to prepare instead.

However I see similar implementations do option1.

Can clk_prepare also enable the clocks also.

With Regards,
Shubhrajyoti

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


boot param to change tick

2016-06-20 Thread Lax Clarke
Is there a way to change a grub/lilo kernel boot param to change the kernel
tick rate?
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


coding style: "obj-y" versus "obj-$(CONFIG_FOO)"?

2016-06-20 Thread Robert P. J. Day

  a bit more pedantry ... in init/Makefile, i see this test:

ifneq ($(CONFIG_BLK_DEV_INITRD),y)
obj-y  += noinitramfs.o
else
obj-$(CONFIG_BLK_DEV_INITRD)   += initramfs.o
endif

which is perfectly correct, but since BLK_DEV_INITRD is defined as a
boolean, it can be assigned only yes or no, so is there any reason
that second assignment wasn't written simply as:

obj-y  += initramfs.o

  sure, it's picky, but whenever i see Makefile content of the form:

obj-$(CONFIG_FOO)

i take into account that that could be a tristate setting. if it
isn't, it just makes more sense aesthetically to me to use "obj-y" for
clarity.

  is there a coding style note about this sort of thing?

rday

-- 


Robert P. J. Day Ottawa, Ontario, CANADA
http://crashcourse.ca

Twitter:   http://twitter.com/rpjday
LinkedIn:   http://ca.linkedin.com/in/rpjday



___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


what is the minimal version of make supported for building the kernel?

2016-06-20 Thread Robert P. J. Day

  another curiosity related to my current travels through the
initramfs code, i noticed this git commit from back in 2013:

$ git show 7ac1815683
commit 7ac181568342ec618d4da1ab03c2babcaa7ee84f
Author: Jan Beulich 
Date:   Wed Dec 18 17:08:57 2013 -0800

fix build with make 3.80

According to Documentation/Changes, make 3.80 is still being supported
for building the kernel, hence make files must not make (unconditional)
use of features introduced only in newer versions.

Commit 1bf49dd4be0b ("./Makefile: export initial ramdisk compression
config option") however introduced "else ifeq" constructs which make
3.80 doesn't understand.  Replace the logic there with more conventional
(in the kernel build infrastructure) list constructs (except that the
list here is intentionally limited to exactly one element).

Signed-off-by: Jan Beulich 
Cc: P J P 
Signed-off-by: Andrew Morton 
Signed-off-by: Linus Torvalds 

diff --git a/Makefile b/Makefile
index 858a147..89cee86 100644
--- a/Makefile
+++ b/Makefile
@@ -732,19 +732,13 @@ export mod_strip_cmd
 # Select initial ramdisk compression format, default is gzip(1).
 # This shall be used by the dracut(8) tool while creating an
initramfs image.
 #
-INITRD_COMPRESS=gzip
-ifeq ($(CONFIG_RD_BZIP2), y)
-INITRD_COMPRESS=bzip2
-else ifeq ($(CONFIG_RD_LZMA), y)
-INITRD_COMPRESS=lzma
-else ifeq ($(CONFIG_RD_XZ), y)
-INITRD_COMPRESS=xz
-else ifeq ($(CONFIG_RD_LZO), y)
-INITRD_COMPRESS=lzo
-else ifeq ($(CONFIG_RD_LZ4), y)
-INITRD_COMPRESS=lz4
-endif
-export INITRD_COMPRESS
+INITRD_COMPRESS-y  := gzip
+INITRD_COMPRESS-$(CONFIG_RD_BZIP2) := bzip2
+INITRD_COMPRESS-$(CONFIG_RD_LZMA)  := lzma
+INITRD_COMPRESS-$(CONFIG_RD_XZ):= xz
+INITRD_COMPRESS-$(CONFIG_RD_LZO)   := lzo
+INITRD_COMPRESS-$(CONFIG_RD_LZ4)   := lz4
+export INITRD_COMPRESS := $(INITRD_COMPRESS-y)

... etc etc ...

  now, Documentation/Changes currently does indeed state:

Current Minimal Requirements

... snip ...
o  GNU make   3.80# make --version

but i did a quick grep to find:

  $ grep -r "else ifeq" *
  lib/raid6/test/Makefile:else ifeq ($(HAS_NEON),yes)
  $

so would that single test not violate the rule just described above?
is Documentation/Changes entirely up to date with respect to minimal
requirements?

rday

-- 


Robert P. J. Day Ottawa, Ontario, CANADA
http://crashcourse.ca

Twitter:   http://twitter.com/rpjday
LinkedIn:   http://ca.linkedin.com/in/rpjday



___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


IPV6 Multipath support

2016-06-20 Thread Narasimha M
Hi All,

I am using linux kernel 3.10.20, and tried to add multipath routes
using the below commands.

ip -6 route add default nexthop via ::1 dev eth1 weight 1 nexthop
via ::2 dev eth0 weight 1.

But when i run the traffic to the host reachable to both the
interfaces, traffic is always going through eth1, which means the
multipath routing is not working.

Could you please let us know that do we have multipath support for
ipv6 in linux3.10.20 kernel ?

Thanks in advance.

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


confused about use of "INITRD_COMPRESS" lines in top-level Makefile

2016-06-20 Thread Robert P. J. Day

  currently poring over the initramfs code, and i'm a bit curious
about the following.

  in usr/Kconfig, all the possible compression protocols can be
selected, and by default are:

config RD_GZIP
bool "Support initial ramdisks compressed using gzip"
default y
select DECOMPRESS_GZIP
help
  Support loading of a gzip-encoded initial ramdisk or cpio buffer.
  If unsure, say Y.

config RD_BZIP2
bool "Support initial ramdisks compressed using bzip2"
default y
select DECOMPRESS_BZIP2
help
  Support loading of a bzip2-encoded initial ramdisk or cpio buffer.
  If unsure, say N.

... etc etc ...

but in the top-level Makefile, here are the lines that ostensibly
select which compression to actually use:

  # Select initial ramdisk compression format, default is gzip(1).
  # This shall be used by the dracut(8) tool while creating an initramfs image.
  #
  INITRD_COMPRESS-y  := gzip
  INITRD_COMPRESS-$(CONFIG_RD_BZIP2) := bzip2
  INITRD_COMPRESS-$(CONFIG_RD_LZMA)  := lzma
  INITRD_COMPRESS-$(CONFIG_RD_XZ):= xz
  INITRD_COMPRESS-$(CONFIG_RD_LZO)   := lzo
  INITRD_COMPRESS-$(CONFIG_RD_LZ4)   := lz4
  # do not export INITRD_COMPRESS, since we didn't actually
  # choose a sane default compression above.
  # export INITRD_COMPRESS := $(INITRD_COMPRESS-y)

so as i read this, the single compression protocol selected will be
the last one configured in that list, but where is that variable
eventually used? where is the build code or utility that examines the
value eventually set and invokes dracut, as the comment suggests?

rday

-- 


Robert P. J. Day Ottawa, Ontario, CANADA
http://crashcourse.ca

Twitter:   http://twitter.com/rpjday
LinkedIn:   http://ca.linkedin.com/in/rpjday



___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


[PATCH] Small number of aesthetic/dependency cleanups in usr/Kconfig

2016-06-20 Thread Robert P. J. Day

* Remove superfluous dependencies on BLK_DEV_INITRD.
* Couple grammar fixes.
* Add proper hyphenation.
* Add periods at end of some help sentences.

Signed-off-by: Robert P. J. Day 

---

  only place i'm not absolutely confident is the removal of those
dependency lines but, AFAICT, this Kconfig file is sourced only from
init/Kconfig, which contains:

  if BLK_DEV_INITRD

  source "usr/Kconfig"

  endif

so unless that Kconfig file is sourced from elsewhere, this should be
fine.


diff --git a/usr/Kconfig b/usr/Kconfig
index 572dcf7..392021d 100644
--- a/usr/Kconfig
+++ b/usr/Kconfig
@@ -26,7 +26,7 @@ config INITRAMFS_ROOT_UID
depends on INITRAMFS_SOURCE!=""
default "0"
help
- This setting is only meaningful if the INITRAMFS_SOURCE is
+ This setting is only meaningful if the INITRAMFS_SOURCE
  contains a directory.  Setting this user ID (UID) to something
  other than "0" will cause all files owned by that UID to be
  owned by user root in the initial ramdisk image.
@@ -38,7 +38,7 @@ config INITRAMFS_ROOT_GID
depends on INITRAMFS_SOURCE!=""
default "0"
help
- This setting is only meaningful if the INITRAMFS_SOURCE is
+ This setting is only meaningful if the INITRAMFS_SOURCE
  contains a directory.  Setting this group ID (GID) to something
  other than "0" will cause all files owned by that GID to be
  owned by group root in the initial ramdisk image.
@@ -47,54 +47,48 @@ config INITRAMFS_ROOT_GID

 config RD_GZIP
bool "Support initial ramdisks compressed using gzip"
-   depends on BLK_DEV_INITRD
default y
select DECOMPRESS_GZIP
help
- Support loading of a gzip encoded initial ramdisk or cpio buffer.
+ Support loading of a gzip-encoded initial ramdisk or cpio buffer.
  If unsure, say Y.

 config RD_BZIP2
bool "Support initial ramdisks compressed using bzip2"
default y
-   depends on BLK_DEV_INITRD
select DECOMPRESS_BZIP2
help
- Support loading of a bzip2 encoded initial ramdisk or cpio buffer
+ Support loading of a bzip2-encoded initial ramdisk or cpio buffer.
  If unsure, say N.

 config RD_LZMA
bool "Support initial ramdisks compressed using LZMA"
default y
-   depends on BLK_DEV_INITRD
select DECOMPRESS_LZMA
help
- Support loading of a LZMA encoded initial ramdisk or cpio buffer
+ Support loading of a LZMA-encoded initial ramdisk or cpio buffer.
  If unsure, say N.

 config RD_XZ
bool "Support initial ramdisks compressed using XZ"
-   depends on BLK_DEV_INITRD
default y
select DECOMPRESS_XZ
help
- Support loading of a XZ encoded initial ramdisk or cpio buffer.
+ Support loading of a XZ-encoded initial ramdisk or cpio buffer.
  If unsure, say N.

 config RD_LZO
bool "Support initial ramdisks compressed using LZO"
default y
-   depends on BLK_DEV_INITRD
select DECOMPRESS_LZO
help
- Support loading of a LZO encoded initial ramdisk or cpio buffer
+ Support loading of a LZO-encoded initial ramdisk or cpio buffer.
  If unsure, say N.

 config RD_LZ4
bool "Support initial ramdisks compressed using LZ4"
default y
-   depends on BLK_DEV_INITRD
select DECOMPRESS_LZ4
help
- Support loading of a LZ4 encoded initial ramdisk or cpio buffer
+ Support loading of a LZ4-encoded initial ramdisk or cpio buffer.
  If unsure, say N.

-- 


Robert P. J. Day Ottawa, Ontario, CANADA
http://crashcourse.ca

Twitter:   http://twitter.com/rpjday
LinkedIn:   http://ca.linkedin.com/in/rpjday



___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Use of list_head struct

2016-06-20 Thread Robert P. J. Day
On Mon, 20 Jun 2016, Bogdan PRICOP wrote:

> Bogdan PRICOP
> 
> Mobile: +353 86 075 3349
> E-mail: pric...@gmail.com
> 
>
> On 17 June 2016 at 11:35, Pranay Srivastava  wrote:
> >
> > On Fri, Jun 17, 2016 at 3:41 PM, Martin Houry  wrote:
> > > Hello mailing list!
> > > I've read some code in the NFS4.1 client. I have trouble to access
> > > variables in a list_head.
> > >
> > > So I have :
> > > (include/linux/sunrpc/xprt.h line 168)
> > > struct rpc_xprt{
> > > .
> > > .
> > >
> > > struct rpc_wait_queue pending; /* requests in flight */
> > > .
> > > .
> > > }
> > >
> > > ==>
> > >
> > > struct rpc_wait_queue {
> > > .
> > > struct list_headtasks[RPC_NR_PRIORITY]; /* task queue for
> > > each priority level */
> > > .
> > > }
> > >
> > > The struct "list_head" is a classical  linked list. But How do I know
> > > the type of the struct in this list?
> > > I can maybe guess the struct in it :
> > >
> > > struct rpc_task {}
> > >
> > > But how can I be certain that "struct list_head tasks" contains some
> > > "struct rpc_task"?
> >
> > some magic value perhaps?
> >
> > >
> > > I'm new here, thank you for your help!
> > > Martin
> > >
>
> Hi Martin,
>
> I think the main idea behind Linux kernel implementation of the linked
> list (struct list_head) is to work with any kind of items which need
> to be linked.
>
> Please have a look at the below links which explain the internals of
> Linux kernel list and its usage:
> https://isis.poly.edu/kulesh/stuff/src/klist/
> http://www.makelinux.net/ldd3/chp-11-sect-5

  i wrote a page on that way back here:

http://crashcourse.ca/introduction-linux-kernel-programming/intermission-lets-talk-about-linked-lists-and-containerof-free

as part of a kernel programming course that i *really* need to get
back to someday and update. *sigh*.

rday


-- 


Robert P. J. Day Ottawa, Ontario, CANADA
http://crashcourse.ca

Twitter:   http://twitter.com/rpjday
LinkedIn:   http://ca.linkedin.com/in/rpjday



___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Use of list_head struct

2016-06-20 Thread Bogdan PRICOP
Bogdan PRICOP

Mobile: +353 86 075 3349
E-mail: pric...@gmail.com


On 17 June 2016 at 11:35, Pranay Srivastava  wrote:
>
> On Fri, Jun 17, 2016 at 3:41 PM, Martin Houry  wrote:
> > Hello mailing list!
> > I've read some code in the NFS4.1 client. I have trouble to access
> > variables in a list_head.
> >
> > So I have :
> > (include/linux/sunrpc/xprt.h line 168)
> > struct rpc_xprt{
> > .
> > .
> >
> > struct rpc_wait_queue pending; /* requests in flight */
> > .
> > .
> > }
> >
> > ==>
> >
> > struct rpc_wait_queue {
> > .
> > struct list_headtasks[RPC_NR_PRIORITY]; /* task queue for
> > each priority level */
> > .
> > }
> >
> > The struct "list_head" is a classical  linked list. But How do I know
> > the type of the struct in this list?
> > I can maybe guess the struct in it :
> >
> > struct rpc_task {}
> >
> > But how can I be certain that "struct list_head tasks" contains some
> > "struct rpc_task"?
>
> some magic value perhaps?
>
> >
> > I'm new here, thank you for your help!
> > Martin
> >

Hi Martin,

I think the main idea behind Linux kernel implementation of the linked
list (struct list_head) is to work with any kind of items which need
to be linked.

Please have a look at the below links which explain the internals of
Linux kernel list and its usage:
https://isis.poly.edu/kulesh/stuff/src/klist/
http://www.makelinux.net/ldd3/chp-11-sect-5

Thanks,
Bogdan

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies