Re: Need Suggestions

2018-07-17 Thread Dave Stevens
On Wed, 18 Jul 2018 00:41:56 -0400
valdis.kletni...@vt.edu wrote:

> Were you cd'ed into the directory that had the base of the kernel
> source tree?

I wasn't. I also suggest make help | less

Thanks,

Dave

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


Re: Need Suggestions

2018-07-17 Thread valdis . kletnieks
On Tue, 17 Jul 2018 21:10:05 -0700, Dave Stevens said:

> $ make help
> make: *** No rule to make target 'help'.  Stop.

Were you cd'ed into the directory that had the base of the kernel source tree?

Hint: the directory should look something like this:

[/usr/src/linux-next] ls
COPYINGModule.symvers  certs kernel patches   
signing_key.x509  vmlinux.o
CREDITSNextcryptolibreverts   
sound x509.genkey
Documentation  README  drivers   localversion-next  samples   
tags
Kbuild System.map  firmware  mm sched.h.patch 
tools
Kconfigarchfsmodules.builtinscripts   
usr
LICENSES   block   include   modules.order  security  
virt
MAINTAINERSbuild.default   init  netsigning_key.pem   
vmlinux
Makefile   built-in.a  ipc   null.dwo   signing_key.priv  
vmlinux-gdb.py

(Some files won't be there until you have a successful build - but the COPYING,
CREDITS, and MAINTAINERS files should be there.  If they aren't there, you're
in the wrong directory


pgpgGEkxND4Sj.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Need Suggestions

2018-07-17 Thread inventsekar
Hi Athul...
This is my collegemate's writing, ... This will solve all your
confusions

---

The most important quality that you need to inculcate if you want to do any
kernel space programming is "Patience" (or persistence if you will). Though
it is a good quality for any large scale project, it is a fundamental
requirement for kernel programming. It is very easy to see progress and
make an impact on userspace projects, but even simple changes in the kernel
core will take a lot of time to get accepted, and will often require
multiple rewrites. But fear not, as there are plenty of people who have
conquered this mountain and it is not something to be worried about.

The starting steps will be:

1) Try to understand how to use git . We were (are ?)
not taught to use a version control system in our college and it is such a
fundamental thing. So start using git for college assignments and get the
hang of it.

2) Start writing a lot of C programs and get experienced with pointers,
memory allocation, threading. You can start implementing things like Stack,
Queue, Trees etc. (whatever you study in datastructures) in a simple,
thread-safe way. Do not focus on how you can visualize these datastructures
but how you can effectively implement their functionality and thread
safety. Use pthreads for threading. Do not use any library (like Glib) for
giving you convenient datastructures (like Strings). Implement each of the
things on your own. (But when you are writing code for a product, use a
standard library always instead of re-inventing the wheel)

Write these C programs on Linux and compile using gcc. In our college days
we were using turboc on windows and I hope things have changed. Use a linux
distro (fedora , debian 
, openSUSE , Gentoo  etc.)
exclusively; Do not use Windows (at least for a while) to make yourself
aware of the sysadmin, shell-scripting parts of linux, which will come in
handy.

3) Grab a (any) book on Operating Systems theory and read it. The dinosaur
book  by
Silberschatz et. al. is a good start.

4) Without hesitation buy, Robert Love's Linux Kernel Programming
 book. It is one of the best
beginner material and start reading it parallel to the OS book. This is
easier to read than the previous one and more practical. But the previous
one adds more value and is more theoretical. Handle (3) and (4) in parallel
without blocking on any of the other activities.

5) After you are done with (1) and (2), and feel sufficiently confident
with C and pointers, grab the  linux kernel sources from
http://git.kernel.org/ and try to build the sources yourself.
http://kernelnewbies.org/KernelBuild should help. Learn how to install and
boot with the kernel that you have built.

6.1) Subscribe to Kernel Newbies mailing list
http://kernelnewbies.org/MailingList and read every mail, *even* if you do
not understand most of it.

6.2) Watch: https://www.youtube.com/watch?v=LLBrBBImJt4

6.3) Subscribe to http://lwn.net RSS feeds.

After this, you should be able to fix and send any trivial, documentation,
staging fixes. Once you have done this and get the hang of the process, you
will know how to send patches for any parts of the kernel.

By this time, you would have found your areas of interest in kernel
(filesystems, memory management, io scheduler, CPU scheduling etc.). You
will then have to dig deeper in those particular areas, by:
a) subscribing to the individual mailing lists (such as fs-devel
, etc.)
b) reading about the bug reports for the individual component
c) finding the literature that is relevant for your subsystem (The linux
memory management book
Mel Gorman, etc).

Three other non-technical things that I would recommend are:

1) Create a new email address and use that for all your open source
activities. That way you do not miss any important updates from your
friends.

2) Kernel programming will not give you big money in the short and medium
term (at least in India). If your motivation is not excellence in
engineering, but becoming popular or rich (it is not wrong btw) then you
should focus on some other areas of programming (developing apps, websites,
solving user problems, making meaning etc.).

It will often take months (or even years) before you make a significant
contribution that is not merely a memory leak or bug fix. Be prepared for
that. But since you have age, energy, time (once you get married and/or
have kids you will understand) on your side, it is not that difficult.

Many people try kernel programming and then quit because they do not have
the patience and perseverance. It may also happen that they have found a
more interesting technology at its nascent stage (like Distributed

Re: Need Suggestions

2018-07-17 Thread Dave Stevens
On Wed, 18 Jul 2018 02:35:09 +0200
Richard Siegfried  wrote:

> On 14/07/18 18:04, Athul Joy wrote:
> > Dear friends, I am new to the Linux kernel development.
> > Can anyone help me how to start my journey in order to build my own
> > kernel? 
> For me the debian kernel handbook was a great help especially chapter
> 4 and section 4.6.
> (https://kernel-team.pages.debian.net/kernel-handbook/ch-common-tasks.html#s-kernel-org-package)
> 
> There also is a book from greg kroah hartmann about building your own
> kernel that has a good reputation.
> 
> And I would recommend to start conservative, which means don't try out
> too many new/changed kernel options at once. Start with "make
> oldconfig" or even "make oldconfig". (If you don't know these two
> start with "make help"). 

$ make help
make: *** No rule to make target 'help'.  Stop.

d


You can always read about new kernel options
> and features inside the "make menuconfig" application with pressing
> "?"
> 
> Thanks,
> -- Richard
> 



-- 
In modern fantasy (literary or governmental), killing people is the
usual solution to the so-called war between good and evil. My books are
not conceived in terms of such a war, and offer no simple answers to
simplistic questions.

- Ursula Le Guin

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


Re: Need Suggestions

2018-07-17 Thread Richard Siegfried
On 18/07/18 02:35, Richard Siegfried wrote:
> or even "make oldconfig". (If you don't know these two start with "make
^ should be olddefconfig

Both copy the .config file of your current running kernel and use that
as a basis



signature.asc
Description: OpenPGP digital signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Need Suggestions

2018-07-17 Thread Richard Siegfried
On 14/07/18 18:04, Athul Joy wrote:
> Dear friends, I am new to the Linux kernel development.
> Can anyone help me how to start my journey in order to build my own kernel?
> 
For me the debian kernel handbook was a great help especially chapter 4
and section 4.6.
(https://kernel-team.pages.debian.net/kernel-handbook/ch-common-tasks.html#s-kernel-org-package)

There also is a book from greg kroah hartmann about building your own
kernel that has a good reputation.

And I would recommend to start conservative, which means don't try out
too many new/changed kernel options at once. Start with "make oldconfig"
or even "make oldconfig". (If you don't know these two start with "make
help"). You can always read about new kernel options and features inside
the "make menuconfig" application with pressing "?"

Thanks,
-- Richard



signature.asc
Description: OpenPGP digital signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: mmap with huge page

2018-07-17 Thread David Frank
 Thanks Mike.  I read the doc, which is not explicit on the non used file 
taking up huge page count 
On Tuesday, July 17, 2018, 4:57:04 PM PDT, Mike Kravetz 
 wrote:  
 
 On 07/17/2018 12:05 PM, David Frank wrote:
> Hi,
> According to the instruction, I have to mount a huge directory to hugetlbfs 
> and create file in the huge directory to use the mmap huge page feature. But 
> the issue is that, the files in the huge directory takes up the huge pages 
> configured through
> vm.nr_hugepages =
> 
> even the files are not used.
> 
> When the total size of the files in the huge directory = vm.nr_hugepages * 
> huge page size, then mmap would fail with 'can not allocate memory' if the 
> file to be  mapped is in the huge dir or the call has HUGEPAGETLB flag.
> 
> Basically, I have to move the files off of the huge directory to free up huge 
> pages.
> 
> Am I missing anything here?
> 

No, that is working as designed.

hugetlbfs filesystems are generally pre-allocated with nr_hugepages
huge pages.  That is the upper limit of huge pages available.  You can
use overcommit/surplus pages to try and exceed the limit, but that
comes with a whole set of potential issues.

If you have not done so already, please see Documentation/vm/hugetlbpage.txt
in the kernel source tree.
-- 
Mike Kravetz
  ___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


mmap with huge page

2018-07-17 Thread David Frank
Hi,According to the instruction, I have to mount a huge directory to hugetlbfs 
and create file in the huge directory to use the mmap huge page feature. But 
the issue is that, the files in the huge directory takes up the huge pages 
configured throughvm.nr_hugepages = 

even the files are not used.
When the total size of the files in the huge directory = vm.nr_hugepages * huge 
page size, then mmap would fail with 'can not allocate memory' if the file to 
be  mapped is in the huge dir or the call has HUGEPAGETLB flag.
Basically, I have to move the files off of the huge directory to free up huge 
pages.
Am I missing anything here?
Thanks,
David
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Netpoll APIs

2018-07-17 Thread SeyedAlireza Sanaee
Hi,

I have a question on netpoll and I think it is a good opportunity to ask my
question in this thread,

I have always wondered what is the use cases of netpoll anyway?

Some months ago, I was designing a caching mechanism within the network
stack. I was just polling in NF_IP_PRE_ROUTING and check some keys in my
hash map if it is HIT then I will respond to the incoming request from the
kernel via NETPOLL without engaging the real key-value store(Memcached) in
the userspace! In miss cases I only let the request go through the kernel
network stack and the Memcached application will respond to the request
individually. I only update my hash my with respect the outgoing message
in NF_IP_POST_ROUTING. I intended to reduce the latency of the key-value
stores' requests at the data centers since these key-value stores are
widely deployed in the data center at Facebook and Google.

In my scenario, I only used netpoll as a hack to make my code working
though, however, I never figure out, what problem netpoll intended to solve.

Thank you,
Alireza

On Tue, Jul 17, 2018 at 8:21 PM  wrote:

> On Tue, 17 Jul 2018 18:35:15 +0530, jitendra kumar khasdev said:
>
> > Can netpoll apis send data over the internet. It worked for me in local
> > network but when I try to send data over server which is in cloud not
> able
> > to send it.
> >
> > Can anybody help me out ?
>
> If it works over the local net, time to do the standard network debugging:
>
> Does ping work to/from your cloud target?
> Does traceroute look sane?
> Does ssh/scp work?
> Are your routing tables correct at both ends?
> Is a firewall blocking it somewhere?
> Does 'netstat' show a program listening for your packets at the far end?
> ___
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Netpoll APIs

2018-07-17 Thread valdis . kletnieks
On Tue, 17 Jul 2018 18:35:15 +0530, jitendra kumar khasdev said:

> Can netpoll apis send data over the internet. It worked for me in local
> network but when I try to send data over server which is in cloud not able
> to send it.
>
> Can anybody help me out ?

If it works over the local net, time to do the standard network debugging:

Does ping work to/from your cloud target?
Does traceroute look sane?
Does ssh/scp work?
Are your routing tables correct at both ends?
Is a firewall blocking it somewhere?
Does 'netstat' show a program listening for your packets at the far end?


pgpKXCb7jf4hx.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Netpoll APIs

2018-07-17 Thread jitendra kumar khasdev
Hi All,

Can netpoll apis send data over the internet. It worked for me in local
network but when I try to send data over server which is in cloud not able
to send it.

Can anybody help me out ?


---
Jitendra
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies