Re: transfer physical memory page to swap disk

2020-01-19 Thread Anupam Kapoor
On Sun, 19 Jan 2020 at 6:48 PM Valdis Klētnieks wrote: > On Sun, 19 Jan 2020 12:45:57 +0000, Anupam Kapoor said: > > > > Note that in this case, "naively" includes "not remembering to consider > > > that the page being unmapped may have contained data

Re: transfer physical memory page to swap disk

2020-01-19 Thread Anupam Kapoor
was the lambda. On Sun, Jan 19, 2020 at 11:14 AM Valdis Klētnieks wrote: > On Sun, 19 Jan 2020 10:55:44 +, Anupam Kapoor said: > > > but if _all_ that is required is randomly unmapping some marked > > application pages, _that_ can be naively 'done' by the applica

Re: transfer physical memory page to swap disk

2020-01-19 Thread Anupam Kapoor
On Wed, 15 Jan 2020 18:23:05 +0530, Anupam Kapoor said: >> On Wed, 15 Jan 2020 at 6:02 PM Sumit Kumar wrote: >>> Does C/C++ provide any API / system call that enables user to force the >>> application to transfer some its physical pages to swap disk ? If so, is it >

Re: transfer physical memory page to swap disk

2020-01-15 Thread Anupam Kapoor
On Wed, 15 Jan 2020 at 6:02 PM Sumit Kumar wrote: > Hi, > Does C/C++ provide any API / system call that enables user to force the > application to transfer some its physical pages to swap disk ? If so, is it > also possible to obtain the least used page using some API ? > would madvise not

Re: Fwd: Question about arp caches

2016-11-30 Thread Anupam Kapoor
On Wed, Nov 30, 2016 at 1:46 PM, Yisu Peng wrote: > So, how is the kernel check those staled arp entries? Or, what is the > mechanism that the kernel uses to find the out of date entries? ​ok sure, well, each neighbor entry (struct neighbour) has a 'timer' (which is created

Fwd: Question about arp caches

2016-11-29 Thread Anupam Kapoor
FYI -- Forwarded message - From: Anupam Kapoor <anupam.kap...@gmail.com> Date: Tue, 29 Nov 2016 at 1:25 PM Subject: Re: Question about arp caches To: Shawn Peng <yisup...@gmail.com> ​On Tue, Nov 29, 2016 at 12:49 PM, Shawn Peng <yisup...@gmail.com> wr

Re: Question about arp caches

2016-11-28 Thread Anupam Kapoor
On Tue, Nov 29, 2016 at 10:40 AM, Shawn Peng wrote: > I'm reading the code about arp protocol. It seems like the kernel uses > the neigh_table structure to keep track of caches, right? > ​yes.​ > There should > be some code that remove the stale entries in the cache, but I

Re: IEEE-754 Float to int

2016-11-23 Thread Anupam Kapoor
On Wed, Nov 23, 2016 at 6:00 PM, Lucas Tanure wrote: > The best way to do it seems to be to write conversion function. > Receive the float in a u32, parse it's bits and return a s32. Can be > done without the use of floats. > ​but this conversion-function might not be

Re: IEEE-754 Float to int

2016-11-22 Thread Anupam Kapoor
On Tue, Nov 22, 2016 at 9:51 PM, Lucas Tanure wrote: > But this "some-float-value" must be declared as float ? Can I do that ? > ​in your example, isn't 'value' a float type​ already ? ​-- kind regards anupam​ In the beginning was the lambda, and the lambda was with Emacs,

Re: IEEE-754 Float to int

2016-11-22 Thread Anupam Kapoor
On Tue, Nov 22, 2016 at 9:35 PM, Lucas Tanure wrote: > So, value has a 32bit float now, and I would like to print just the > integer part, like : > Read 26.92387 --> Print 26. > ​how about just typecasting to int ? so : int x = (int)(some-float-value) that should be it

Re: unable to find function definition

2016-04-27 Thread Anupam Kapoor
> [2016-04-28T01:56:26+0530]: "Jakub Sitnicki" (jakub-sitnicki): ,[ jakub-sitnicki ] | An alternative would be to use cscope: | | $ # build the index (will take a moment) | $ make cscope ` this ! cscope generally just works for way better than other 'manual' mechanisms. since it

Re: Microsoft wireless usb mouse frequently fails to detect in ubuntu 15.10/16.04

2016-04-21 Thread Anupam Kapoor
> [2016-04-21T10:23:01+0530]: "rootsr" (rootsr): ,[ rootsr ] | [ 74.186391] usb 1-1.3: new full-speed USB device number 7 using ehci-pci | [ 74.258396] usb 1-1.3: device descriptor read/64, error -32 ` see if this helps :

Re: Backtrace of every the threads

2016-02-10 Thread Anupam Kapoor
> [2016-02-10T15:06:30+0530]: "Ricardo Ribalda Delgado" (ricardo-delgado): ,[ ricardo-delgado ] | Unfortunately not :( But thanks for trying :) ` seems to work just fine on a trivial program here: < aside: hopefully, i will not be judged too harshly for c++ :) > , | anupam@fatcat

Re: Backtrace of every the threads

2016-02-10 Thread Anupam Kapoor
> [2016-02-10T16:26:40+0530]: "Ricardo Ribalda Delgado" (ricardo-delgado): ,[ ricardo-delgado ] | By thread I mean kernel thread, and user thread. | | What i want to get is a back trace of ALL the programs running in user | and kernel space. ` d.u.d.e :) -- kind regards anupam

Re: Backtrace of every the threads

2016-02-10 Thread Anupam Kapoor
> [2016-02-10T14:35:33+0530]: "Ricardo Ribalda Delgado" (ricardo-delgado): ,[ ricardo-delgado ] | Luckily, the error is gone now :). but I was wondering if there is a | way to show the backtrace of ALL the threads in the system, which | could have been a wonderful tool to debug this

Re: Capture packets at 10g interface

2016-01-29 Thread Anupam Kapoor
On Saturday 30 January 2016, Daniel Ng wrote: > > >> On Fri, Jan 29, 2016 at 07:37:57PM +0530, Tarun Batra wrote: > >> We are trying to build product and as per decisions of senior we need to > >> capture packets in kernel > > > My understanding is 10G interfaces push

Re: how to use wait_event_interruptible_timeout with less than 1 jiffie timeout?

2016-01-20 Thread Anupam Kapoor
> [2016-01-20T13:55:54+0530]: "Nicholas Mc Guire" (Nicholas): ,[ Nicholas ] | that would still have the same limitation with resepct to time granuarlity | and as Documentation/timers/ ` ah yes, that's true. ,[ Nicholas ] | if you really need very short delays then you will need

Re: how to use wait_event_interruptible_timeout with less than 1 jiffie timeout?

2016-01-19 Thread Anupam Kapoor
> [2016-01-20T01:21:18+0530]: "Daniel." (Daniel): ,[ Daniel ] | I have some code that convert an timeout comming from userspace (in | ms) to jiffies prior passing to wait_event_interrupitible_timeout(). | The code looks like this: | | unsigned long tout = user.timeout * HZ / 1000; /*

Re: viability of supporting interrupts in user space driver?

2015-11-20 Thread Anupam Kapoor
> [2015-11-20T13:08:46+0530]: "Robert P. J. Day" (robert-pj-day): ,[ robert-pj-day ] | some colleagues are considering implementing some user space drivers | that need to recognize and process interrupts. i'm aware of the | possibilities -- UIO, for example -- but other than the technical

Re: looking for decent, current online discussion of user-space drivers

2015-11-17 Thread Anupam Kapoor
> [2015-11-17T15:43:52+0530]: "Robert P. J. Day" (rpjday): ,[ rpjday ] | | in particular, are there any nice examples of this that | can be downloaded, built and played with? thanks muchly. ` there is snabbswitch (https://github.com/SnabbCo/snabbswitch) where folks have written

Re: How to disable "module verification failed: signature and/or required key missing - tainting kernel" message?

2015-11-02 Thread Anupam Kapoor
> [2015-11-02T12:59:30+0530]: "Nan Xiao" (nan-xiao): ,[ nan-xiao ] | I don't disable CONFIG_MODULE_SIG configuration in kernel. Since from this | post (http://stackoverflow.com/questions/24975377/kvm-module-verification-failed-signature-and-or-required-key-missing-taintin), | the answer

Re: How to disable "module verification failed: signature and/or required key missing - tainting kernel" message?

2015-11-02 Thread Anupam Kapoor
> [2015-11-02T14:36:52+0530]: "Nan Xiao" (nan-xiao): ,[ nan-xiao ] | Sorry, I am a little confused about your explanation. ` ah sorry about that. i just re-read your original post, and realized that you _are_ able to load the unsigned/badly-signed module. the only point of concern is

Re: How to disable "module verification failed: signature and/or required key missing - tainting kernel" message?

2015-11-01 Thread Anupam Kapoor
> [2015-11-02T11:27:10+0530]: "Nan Xiao" (nan-xiao): ,[ nan-xiao ] | When the vendor Linux system enable "kernel module signature | verification" mechanism, | if install your own built module, the kernel will complain: | | module verification failed: signature and/or required key missing

Re: How to get user level stack trace of an application from system crash

2015-10-07 Thread Anupam Kapoor
> [2015-10-07T14:55:07+0530]: "Shailendra Rana" (shailendra.rana1982): ,[ shailendra.rana1982 ] | The application traps file events and send them over to other system | via TCP. This other machine is running a third party solution which | process these events and sends the verdict to the

Re: Knowledge of Protocols

2015-07-09 Thread Anupam Kapoor
[2015-07-09T23:26:15+0530]: Mohit . (Mohit): ,[ Mohit ] | I have just finished C linux application programming with a tinge of socket programming. | I would like to know what do statements like the following mean | | - Have knowledge of Protocols such as TCP/IP, IPSec, IPV6 or SSL |

Re: xtime variable in kernel 4.0

2015-04-14 Thread Anupam Kapoor
[2015-04-14T18:17:08+0530]: Mohammad A Khasawneh (mohammad-Khasawneh): ,[ mohammad-Khasawneh ] | I'm trying to develop a syscall in kernel v4.0 which copies the xtime | variable to user space. I can find the variable in 3.X but it seems to have | been changed in 4.0. Can anyone point me to

Re: Learning things

2015-04-06 Thread Anupam Kapoor
[2015-04-07T00:08:10+0530]: Mike Thompson (mike-thompson): ,[ mike-thompson ] | As others mention, using the Linux kernel to come up to speed with C is the | wrong approach. If you have a strong desire to learn kernel programming | concepts while coming up to speed on C, I would suggest

Re: Difference between System.map and /proc/kallsyms

2015-03-09 Thread Anupam Kapoor
[2015-03-09T11:30:00+0530]: Jamal (Jamal): ,[ Jamal ] | Hi.. | | After reading Documentation on System.map, i understood that , whenever | an oops happens the following addresses will be converted to its | function name by klogd daemon using System.map. | | Now when we have

Re: What happens when an interrupt comes while in middle of printk?

2015-02-24 Thread anupam kapoor
[2015-02-25T08:37:59+0530]: manty kuma (manty-kuma): ,[ manty-kuma ] | What happens if an interrupt comes while in middle of printk execution and | the interrupt handler has a printk in it? | | There is a chance that the log_buf could be corrupted. isn't it? ` no this doesn't happen.

Re: unlikely compiler flag propagation

2015-02-19 Thread Anupam Kapoor
[2015-02-19T00:08:01+0530]: Nicholas Mc Guire (nicholas-mcguire): nicholas-mcguire On Wed, 18 Feb 2015, Greg KH wrote: ,[ greg-kh ] | As proof of this, there was a test of the kernel a year or so ago that | measured the placement of the existing likely/unlikely markers in the | kernel and

Re: VLAN tagged packets received by application are corrupted

2014-11-20 Thread Anupam Kapoor
most likely you offload enabled on your card, try disabling that to see if tcpdump does the right thing for you kind regards anupam On Fri, Nov 21, 2014 at 10:19 AM, Amit Agarwal a...@amit-agarwal.co.in wrote: Hi all, I have query on vlan tagged packets received by network interface.

Re: Socket receive, send

2014-10-13 Thread Anupam Kapoor
the best resource that _i_ know of (and probably you know it too) is http://www.linuxfoundation.org/collaborate/workgroups/networking/mainpage, see if that helps kind regards anupam On Tue, Oct 14, 2014 at 7:42 AM, Grzegorz Dwornicki gd1...@gmail.com wrote: Hey Is there a good documentation

Re: I remove the audit and selinux from kernel and start the new kernel in Centos, but i can't bring up the network device, Why?

2014-10-12 Thread Anupam Kapoor
imho, not a pertinent topic for this list kind regards anupam On Mon, Oct 13, 2014 at 10:34 AM, sizel si...@163.com wrote: ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org

Re: U64 Ordering in File System Code of Btrfs

2014-08-28 Thread anupam kapoor
[Thu, 28 Aug 2014 00:54:47 -0400]: nick (nick): ,[ nick ] | Hey Guys, | Thanks for the help so far. I am wondering after reading the btrfs | code for certain functions there seem to | be a lot of u64 variable and function returns of this type. Is this | common in file system due to the disk |

Re: userspace stack start and end

2014-07-27 Thread anupam kapoor
[Sun, 27 Jul 2014 11:52:27 -0500]: Xin Tong (xin-tong): ,[ xin-tong ] | I am trying to find the start and end address of the userspace stack. | I see in the task_struct there is start_stack. But I could not find | end_start anywhere in the kernel code ? | | Can someone please tell me how to

Re: userspace stack start and end

2014-07-27 Thread anupam kapoor
[Sun, 27 Jul 2014 22:35:22 -0500]: Xin Tong (xin-tong): ,[ xin-tong ] | where is user:stack-segment-size defined ? ` that is computable once again :) (assuming x86, and 1+3 split) user:stack-segment-size = ((unsigned long)(0xc000 - user:start-stack)) PAGE_SHIFT kind regards

Re: Exporting ioctls from out-of-tree module to userspace

2014-07-17 Thread Anupam Kapoor
hi, in the older kernels (anything before the commit id mentioned below), there is include/Kbuild, where you can do something like this: header-y += ../../quick-hacks/kernel-modules/mymodule/ and then do a 'make headers_install' from the *source* tree, which seems to do the right thing. in

Re: Path of network packet in kernel

2014-07-15 Thread Anupam Kapoor
a 'slightly' more indepth look: http://www.linuxfoundation.org/images/1/1c/Network_data_flow_through_kernel.png kind regards anupam On Tue, Jul 15, 2014 at 10:33 PM, Jeff Haran jeff.ha...@citrix.com wrote: This helps me to see the forest for the trees. And it's pretty current:

Re: writting NIC driver for IPV6

2011-06-29 Thread Anupam Kapoor
2011/6/29 Gang Lei (雷刚) gang@mediatek.com Thanks a lot, Michi. Then how can I verify that IPV6 can be really running on our NIC? Of course I have to build a kernel which can support IPV6 firstly, but how to verify it’s really working? Use ping6? yes apart from ping6, you can use:

Re: Disabling nagle algorithm

2011-05-31 Thread Anupam Kapoor
yet another option would be to setup point-to-point ethernet device (^^) via tun/tap drivers. you can have a userland program receiving data from the said device, and then use whatever options you want there. anupam On Tue, May 31, 2011 at 8:11 AM, Anupam Kapoor anupam.kap...@gmail.com wrote

Re: Disabling nagle algorithm

2011-05-29 Thread Anupam Kapoor
afaik, it disables tcp-prequeue nothing to do with nagle anyways. also, doing this might have marginal benefits if anything at all due to most overhead being specific to context switching than anything else. anupam On Sun, May 29, 2011 at 11:04 PM, C K Kashyap ckkash...@gmail.com wrote: Hi, Is