Re: question about boot_params global variables

2022-11-20 Thread jim . cromie
On Mon, Nov 14, 2022 at 11:41 AM Saad Masood wrote: > > Hi Jim, > In C, two global variables with the same name are converted to one global > variable (same memory address space). So, the same variable is referenced > with or without the 'extern' keyword. > > Thanks, > > thanks Saad,

Re: question about boot_params global variables

2022-11-14 Thread Saad Masood
Hi Jim, In C, two global variables with the same name are converted to one global variable (same memory address space). So, the same variable is referenced with or without the 'extern' keyword. Thanks, Saad On Mon, Nov 14, 2022 at 11:23 AM wrote: > On Tue, Aug 16, 2022 at 4:10 AM

Re: question about boot_params global variables

2022-11-14 Thread jim . cromie
On Tue, Aug 16, 2022 at 4:10 AM shiyu chou wrote: > > Hello all: > In arch x86 directory I found two global variables with the same name(master > branch): > 1.arch/x86/boot/main.c > near line 18: struct boot_params boot_params __attribute__((aligned(16))); > 2.arch/x86/kernel/setup.c > near line

question about boot_params global variables

2022-08-16 Thread shiyu chou
Hello all: In arch x86 directory I found two global variables with the same name(master branch): 1.arch/x86/boot/main.c near line 18: struct boot_params boot_params __attribute__((aligned(16))); 2.arch/x86/kernel/setup.c near line 75: struct boot_params boot_params; Is that wrong to define two

RE: A question about memblock.reserved

2022-06-28 Thread Chan Kim
ave a nice day! Chan Kim >>-Original Message- >>From: Wonhyuk Yang >>Sent: Friday, June 24, 2022 3:41 PM >>To: Chan Kim >>Cc: kernelnewbies >>Subject: Re: A question about memblock.reserved >> >>On Thu, Jun 23, 2022 at 2:25 PM Chan Kim

Re: A question about memblock.reserved

2022-06-24 Thread Wonhyuk Yang
On Thu, Jun 23, 2022 at 2:25 PM Chan Kim wrote: > > I mm/memblock.c I see this struct memblock memblock which is initialized with > empty list. > > static struct memblock_region > memblock_memory_init_regions[INIT_MEMBLOCK_REGIONS] __initdata_memblock; > static struct memblock_region >

A question about memblock.reserved

2022-06-22 Thread Chan Kim
Hello all, I mm/memblock.c I see this struct memblock memblock which is initialized with empty list. static struct memblock_region memblock_memory_init_regions[INIT_MEMBLOCK_REGIONS] __initdata_memblock; static struct memblock_region

Re: A question about linux pipes

2022-05-14 Thread Aruna Hewapathirane
> On Fri, May 13, 2022 at 11:46 AM xhighway999 wrote: > > Hi Guys, > sorry to bother you all. But I have a simple question about Linux Pipes. > Is the following statement right or wrong: > "Named pipes can be used to transfer data from one process to multiple other proce

A question about iommu, passing to the device user data containing pointers

2022-05-01 Thread Chan Kim
Hello linux experts, I'm almost sure my understanding is correct but hope someone could confirm me if it's really correct. Suppose a user program wants to pass to a device some data structures connected to each other using pointers and the device processes the data with dma capability(meaning it

A question about regmap bus

2021-12-07 Thread Clyde Huang31
Hi All, We have an FPGA device and it is connect to a SOC through the SPI interface. The communication is using a specific protocol like as bellow. Read a register: < Bits > ++

Question about "barrier()" in the SLUB's fast path

2021-11-11 Thread Wonhyuk Yang
Hi, Recently, I had difficulty understanding the meaning of the barrier() in the slab_alloc_node(). The comments are written like this. /* * Irqless object alloc/free algorithm used here depends on sequence * of fetching cpu_slab's data. tid should be fetched before anything * on c to guarantee

Re: A question about staging driver like pi433

2021-08-12 Thread Sidong Yang
On Tue, Aug 10, 2021 at 08:12:46AM +0200, Greg KH wrote: > On Mon, Aug 09, 2021 at 11:27:13PM +, Sidong Yang wrote: > > On Mon, Aug 09, 2021 at 08:20:03PM +0200, Greg KH wrote: > > > On Mon, Aug 09, 2021 at 04:13:28PM +, Sidong Yang wrote: > > > > Hi all, >

Re: A question about staging driver like pi433

2021-08-10 Thread Greg KH
On Mon, Aug 09, 2021 at 11:27:13PM +, Sidong Yang wrote: > On Mon, Aug 09, 2021 at 08:20:03PM +0200, Greg KH wrote: > > On Mon, Aug 09, 2021 at 04:13:28PM +, Sidong Yang wrote: > > > Hi all, > > > > > > I have a question about staging driver. I'm a

Re: A question about staging driver like pi433

2021-08-09 Thread Sidong Yang
On Mon, Aug 09, 2021 at 08:20:03PM +0200, Greg KH wrote: > On Mon, Aug 09, 2021 at 04:13:28PM +, Sidong Yang wrote: > > Hi all, > > > > I have a question about staging driver. I'm a newbie kernel developer > > and I tried contributed some patches for staging dr

Re: A question about staging driver like pi433

2021-08-09 Thread Greg KH
On Mon, Aug 09, 2021 at 04:13:28PM +, Sidong Yang wrote: > Hi all, > > I have a question about staging driver. I'm a newbie kernel developer > and I tried contributed some patches for staging drivers. In those > staging drivers, I'm interested in pi433 and wrote some patches f

A question about staging driver like pi433

2021-08-09 Thread Sidong Yang
Hi all, I have a question about staging driver. I'm a newbie kernel developer and I tried contributed some patches for staging drivers. In those staging drivers, I'm interested in pi433 and wrote some patches for it about 2 years ago. and then I tried to go deeper for that. I tried to buy pi433

RE: a question about dma_set_mask function

2021-07-22 Thread ckim
done by iommu). dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *handle, gfp_t gfp) Any help will be really appreciated. Thanks! Chan Kim From: c...@etri.re.kr Sent: Thursday, July 22, 2021 4:33 PM To: kernelnewbies@kernelnewbies.org Subject: a question about dma_set_mask

a question about dma_set_mask function

2021-07-22 Thread ckim
Hello, I have a question about DNA (I was reading DMA-API-HOWTO.txt <https://www.kernel.org/doc/Documentation/DMA-API-HOWTO.txt> ). You know regarding DMA, there is cpu virtual address, cpu physical address and bus address for the device. Bus address is converted to cpu physical a

Question about the linux switch_to macro parameters

2021-04-22 Thread 武广阔
I read the source code in kernel(kernel/sched.c): (include/asm-i386/system.h) My question is that: switch_to is defined as a macro, so I thoutht it will expand "=a" (last) as "=a" (prev), if that the last parameter is just for easy to read, is that

RE: question about ioport_map function

2021-03-21 Thread ckim
table sets the area as uncacheable because it's IO devices) Thanks! Chan Kim From: c...@etri.re.kr Sent: Monday, March 22, 2021 10:28 AM To: kernelnewbies@kernelnewbies.org Subject: question about ioport_map function Hello all >From what I understand, to map io ports to virtual memory,

question about ioport_map function

2021-03-21 Thread ckim
Hello all >From what I understand, to map io ports to virtual memory, we should use request_region, ioport_map/unmap and ioread/write functions. These are for architectures having input, output machine instructions like x86, x86_64. And the return address of ioport_map is physical address. Is

Re: question about arm64 __primary_switched code

2020-11-29 Thread Wonhyuk Yang
On Mon, Nov 30, 2020 at 10:08 AM wrote: > __primary_switched: > adrpx4, init_thread_union -- line 1 > add sp, x4, #THREAD_SIZE-- line 2 > adr_l x5, init_task -- line 3 > msr sp_el0, x5 // Save thread_info -- line 4 >

RE: question about arm64 __primary_switched code

2020-11-29 Thread ckim
bies > Subject: Re: question about arm64 __primary_switched code > > On Sun, Nov 29, 2020 at 7:52 PM wrote: > > > > I’ll grateful if someone gives me some comments or answers. (it’s > > about understanding arm64 assembly code) > > > > https://stackoverflow.co

Re: question about arm64 __primary_switched code

2020-11-29 Thread Wonhyuk Yang
On Sun, Nov 29, 2020 at 7:52 PM wrote: > > I’ll grateful if someone gives me some comments or answers. (it’s about > understanding arm64 assembly code) > >

question about arm64 __primary_switched code

2020-11-29 Thread ckim
Hello, I have put a question on stackoverflow but nobody answers there yet. I'll grateful if someone gives me some comments or answers. (it's about understanding arm64 assembly code) https://stackoverflow.com/questions/65051120/understanding-arm64-assembly-ad

Re: arm64: Question about barriers with the mmu off

2020-11-17 Thread Wonhyuk Yang
On Tue, Nov 17, 2020 at 3:25 PM Valdis Klētnieks wrote: > > > > > > dc ivac,x1 // invalidate a cache line that's probably OK > > > > > str w0,[x1 // and now we do a store that leaves a possibly stale > > > > > cache line > > > Could you explain me why the store still leaves stale cache? > >

Re: arm64: Question about barriers with the mmu off

2020-11-16 Thread Valdis Klētnieks
On Tue, 17 Nov 2020 14:08:02 +0900, Wonhyuk Yang said: > > > > dc ivac,x1 // invalidate a cache line that's probably OK > > > > str w0,[x1 // and now we do a store that leaves a possibly stale > > > > cache line > Could you explain me why the store still leaves stale cache? > We invalidated

Re: arm64: Question about barriers with the mmu off

2020-11-16 Thread Wonhyuk Yang
On Tue, Nov 17, 2020 at 12:45 PM Valdis Klētnieks wrote: > > > > If you swap them, you get... > > > > > > dc ivac,x1 // invalidate a cache line that's probably OK > > > str w0,[x1 // and now we do a store that leaves a possibly stale cache > > > line > > > > > > In other words, if you swap

Re: arm64: Question about barriers with the mmu off

2020-11-16 Thread Valdis Klētnieks
On Tue, 17 Nov 2020 12:00:32 +0900, Wonhyuk Yang said: > > If you swap them, you get... > > > > dc ivac,x1 // invalidate a cache line that's probably OK > > str w0,[x1 // and now we do a store that leaves a possibly stale cache > > line > > > > In other words, if you swap them you may leave

arm64: Question about barriers with the mmu off

2020-11-16 Thread Wonhyuk Yang
On Tue, Nov 17, 2020 at 11:14 AM Valdis Klētnieks wrote: > If you swap them, you get... > > dc ivac,x1 // invalidate a cache line that's probably OK > str w0,[x1 // and now we do a store that leaves a possibly stale cache line > > In other words, if you swap them you may leave an

Re: arm64: Question about barriers with the mmu off

2020-11-16 Thread Valdis Klētnieks
On Mon, 16 Nov 2020 20:58:52 +0900, Wonhyuk Yang said: > str w0, [x1] So we dirtied the cache line. > dmb sys > dc ivac, x1 // Invalidate potentially stale cache line So we invalidate it. > Is there any problem, if the dc operation precedes the store operation? If you swap them, you get...

arm64: Question about barriers with the mmu off

2020-11-16 Thread Wonhyuk Yang
Hi, I have a question about dmb barriers in arm64's head.S. In the head.S, I could see the pattern below several times. str w0, [x1] dmb sys dc ivac, x1 // Invalidate potentially stale cache line I found that, Commit(fix cache flushing and barriers in set_cpu_boot_mode_flag) explained the code

Re: USB Question about devices being reconnected to the host

2020-10-15 Thread Lucas Tanure
On 10/15/20 1:30 PM, Greg KH wrote: On Thu, Oct 15, 2020 at 01:17:45PM +0100, Lucas Tanure wrote: Hi, I'm learning about USB drivers and I would like to know about disconnecting and reconnecting usb devices. I can see my probe function being called and also the disconnect function. But if

Re: USB Question about devices being reconnected to the host

2020-10-15 Thread Greg KH
On Thu, Oct 15, 2020 at 01:17:45PM +0100, Lucas Tanure wrote: > Hi, > > I'm learning about USB drivers and I would like to know about disconnecting > and reconnecting usb devices. > > I can see my probe function being called and also the disconnect function. > But if I reconnect the device there

USB Question about devices being reconnected to the host

2020-10-15 Thread Lucas Tanure
Hi, I'm learning about USB drivers and I would like to know about disconnecting and reconnecting usb devices. I can see my probe function being called and also the disconnect function. But if I reconnect the device there is no call from the kernel to notify my driver about the device being

Re: Question about the "Dynamic reserved memory" patch

2020-03-12 Thread 양원혁
> On Fri, 13 Mar 2020 12:06:37 +0900, said: > > > In the __reserved_mem_reserve_reg() function, I found something that > > I couldn't easily understand. > > > > To get help, I sent an e-mail to this mailing list. > > > > if (first) { > >

Re: Question about the "Dynamic reserved memory" patch

2020-03-12 Thread Valdis Klētnieks
On Fri, 13 Mar 2020 12:06:37 +0900, said: > In the __reserved_mem_reserve_reg() function, I found something that > I couldn't easily understand. > > To get help, I sent an e-mail to this mailing list. > if (first) { > fdt_reserved_mem_save_node(node,

Question about the "Dynamic reserved memory" patch

2020-03-12 Thread 양원혁
Hi. Recently, I read about the "Dynamic reserved memory" patch. In the __reserved_mem_reserve_reg() function, I found something that I couldn't easily understand. To get help, I sent an e-mail to this mailing list. I attached the code below. static int __init

Re: newbie-level question about cgroups

2019-07-29 Thread Robert P. J. Day
On Sun, 28 Jul 2019, Valdis Klētnieks wrote: > On Sun, 28 Jul 2019 15:39:26 -0400, "Robert P. J. Day" said: > > > no point bugging the actual cgroup people about this since it > > should be simple ... if i need *only* cgroup v2, can i dispense > > entirely with everything under /sys/fs/cgroup/

Re: newbie-level question about cgroups

2019-07-28 Thread Valdis Klētnieks
On Sun, 28 Jul 2019 15:39:26 -0400, "Robert P. J. Day" said: > no point bugging the actual cgroup people about this since it should > be simple ... if i need *only* cgroup v2, can i dispense entirely with > everything under /sys/fs/cgroup/ other than /sys/fs/cgroup/unified? There's a whole

newbie-level question about cgroups

2019-07-28 Thread Robert P. J. Day
no point bugging the actual cgroup people about this since it should be simple ... if i need *only* cgroup v2, can i dispense entirely with everything under /sys/fs/cgroup/ other than /sys/fs/cgroup/unified? rday --

Re: Question about DMA mapping.

2018-08-31 Thread valdis . kletnieks
On Fri, 31 Aug 2018 08:53:29 +0800, "phind@gmail.com" said: > Thank for your time, I'm new to linux kernel. I am reading LDD3 chapter > 15, Dirrect Memory Access section. I see that when I call function > /dma_map_single/ and /dma_unmap_single/, I need to pass a direction as a > parameter.

Question about DMA mapping.

2018-08-30 Thread phind....@gmail.com
Hi everyone, Thank for your time, I'm new to linux kernel. I am reading LDD3 chapter 15, Dirrect Memory Access section. I see that when I call function /dma_map_single/ and /dma_unmap_single/, I need to pass a direction as a parameter. I wonder what is purpose of it? Does It relate to

Re: Question about memcpy

2018-07-14 Thread Himanshu Jha
On Mon, Jul 09, 2018 at 12:16:27PM -0400, valdis.kletni...@vt.edu wrote: > On Mon, 09 Jul 2018 19:34:44 +0530, Himanshu Jha said: > > > I think for these benchmarking stuff, to evaluate the cycles and time > > correctly you should use the __rdtscp(more info at "AMD64 Architecture > >

Re: Question about memcpy

2018-07-13 Thread valdis . kletnieks
On Fri, 13 Jul 2018 11:02:13 +0800, bing zhu said: > I‘m trying to write a simple fs in user space,if memcpy is slower than > kernel , i think it's unfair,as for only cpu for my task, > it's a bit of arbitrary ,i just want my task not interrupted during a > specific time is that possible ?

Re: Question about memcpy

2018-07-12 Thread bing zhu
I‘m trying to write a simple fs in user space,if memcpy is slower than kernel , i think it's unfair,as for only cpu for my task, it's a bit of arbitrary ,i just want my task not interrupted during a specific time is that possible ? 2018-07-12 22:53 GMT+08:00 Greg KH : > A:

Re: Question about memcpy

2018-07-12 Thread valdis . kletnieks
On Thu, 12 Jul 2018 22:27:37 +0800, bing zhu said: > as for memcpy ,kernel is faster than user ,might because schedule ,can i > try to make user as fast as kernel ? Do you have an actual issue where the difference in speed of these two things makes a difference? Or is this primarily a mental

Re: Question about memcpy

2018-07-12 Thread Greg KH
A: http://en.wikipedia.org/wiki/Top_post Q: Were do I find info about this thing called top-posting? A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing in e-mail? A: No. Q: Should I

Re: Question about memcpy

2018-07-12 Thread bing zhu
as for memcpy ,kernel is faster than user ,might because schedule ,can i try to make user as fast as kernel ? 2018-07-12 13:34 GMT+08:00 Greg KH : > On Thu, Jul 12, 2018 at 12:47:12PM +0800, bing zhu wrote: > > agree! a simple rename would survice.results are the same .kernel is > faster > >

Re: Question about memcpy

2018-07-11 Thread Greg KH
On Thu, Jul 12, 2018 at 12:47:12PM +0800, bing zhu wrote: > agree! a simple rename would survice.results are the same .kernel is faster > could anyone help fix this ? Fix what exactly? ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org

Re: Question about memcpy

2018-07-11 Thread bing zhu
agree! a simple rename would survice.results are the same .kernel is faster could anyone help fix this ? 2018-07-11 0:03 GMT+08:00 : > On Tue, 10 Jul 2018 22:51:34 +0800, bing zhu said: > > > Thank you ,I use this func for both kernel and user ,result are same. > > void *memcpy(void *dest, const

Re: Question about memcpy

2018-07-10 Thread valdis . kletnieks
On Tue, 10 Jul 2018 22:51:34 +0800, bing zhu said: > Thank you ,I use this func for both kernel and user ,result are same. > void *memcpy(void *dest, const void *src, size_t n) > { Might want to use 'void *my_memcpy(..)' instead, just in case the build environment plays #define games with you

Re: Question about memcpy

2018-07-10 Thread Greg KH
On Tue, Jul 10, 2018 at 10:51:34PM +0800, bing zhu wrote: > Thank you ,I use this func for both kernel and user ,result are same. > void *memcpy(void *dest, const void *src, size_t n) > { > long d0, d1, d2; > asm volatile( > "rep ; movsq\n\t" > "movq %4,%%rcx\n\t" > "rep ; movsb\n\t" > : "=" (d0),

Re: Question about memcpy

2018-07-10 Thread bing zhu
Thank you ,I use this func for both kernel and user ,result are same. void *memcpy(void *dest, const void *src, size_t n) { long d0, d1, d2; asm volatile( "rep ; movsq\n\t" "movq %4,%%rcx\n\t" "rep ; movsb\n\t" : "=" (d0), "=" (d1), "=" (d2) : "0" (n >> 3), "g" (n & 7), "1" (dest), "2" (src) :

Re: Question about memcpy

2018-07-10 Thread Greg KH
On Tue, Jul 10, 2018 at 12:50:21PM +0800, bing zhu wrote: > I agree !,just i think the problem is still there,memcpy is indeed faster in > kernel than in user,i've tried both ways . Make sure you are actually using the same code for memcpy in both places. Do not rely on your libc or the kernel

Re: Question about memcpy

2018-07-09 Thread bing zhu
I agree !,just i think the problem is still there,memcpy is indeed faster in kernel than in user,i've tried both ways . schedule might be to blame. 2018-07-09 22:04 GMT+08:00 Himanshu Jha : > Hi Bing, > > On Sun, Jul 08, 2018 at 10:03:48PM +0800, bing zhu wrote: > > void *p = malloc(4096 * max);

Re: Question about watchdog

2018-07-09 Thread Ruben Safir
On 07/09/2018 12:17 PM, valdis.kletni...@vt.edu wrote: > Linux doesn't have a "filesystem bus". of course not. i mispoke -- So many immigrant groups have swept through our town that Brooklyn, like Atlantis, reaches mythological proportions in the mind of the world - RI Safir 1998

Re: Question about watchdog

2018-07-09 Thread valdis . kletnieks
On Mon, 09 Jul 2018 09:30:51 -0400, Ruben Safir said: > On 07/08/2018 04:44 PM, valdis.kletni...@vt.edu wrote: > > Error while parsing statement., What is a "filesystem bus" and when does it > > issue a HW interrupt? > You have a hard drive on the system bus and it sends interupts... That's

Re: Question about memcpy

2018-07-09 Thread valdis . kletnieks
On Mon, 09 Jul 2018 19:34:44 +0530, Himanshu Jha said: > I think for these benchmarking stuff, to evaluate the cycles and time > correctly you should use the __rdtscp(more info at "AMD64 Architecture > Programmer’s Manual Volume 3: General-Purpose and System Instructions" > Pg 401) Just beware

Re: Question about memcpy

2018-07-09 Thread Himanshu Jha
Hi Bing, On Sun, Jul 08, 2018 at 10:03:48PM +0800, bing zhu wrote: > void *p = malloc(4096 * max); > start = usec(); > for (i = 0; i < max; i++) { > memcpy(p + i * 4096, page, 4096); > } > end = usec(); > printf("%s : %d time use %lu us \n", __func__, max,end - start); > > static unsigned long

Re: Question about watchdog

2018-07-09 Thread Ruben Safir
On 07/08/2018 04:44 PM, valdis.kletni...@vt.edu wrote: > Error while parsing statement., What is a "filesystem bus" and when does it > issue a HW interrupt? You have a hard drive on the system bus and it sends interupts... Not to mention other devices like network cards, GPUs, Firewire, express

Re: Re: Question about memcpy

2018-07-09 Thread bing zhu
; > *抄送:* kernelnewbies@kernelnewbies.org > *主题:* Re: Question about memcpy > > void *p = malloc(4096 * max); > start = usec(); > for (i = 0; i < max; i++) { > memcpy(p + i * 4096, page, 4096); > } > end = usec(); > printf("%s : %d time use %lu us \n",

Re: Re: Question about memcpy

2018-07-09 Thread 袁建鹏
Kletnieks" 抄送: kernelnewbies@kernelnewbies.org 主题: Re: Question about memcpy void *p = malloc(4096 * max); start = usec(); for (i = 0; i < max; i++) { memcpy(p + i * 4096, page, 4096); } end = usec(); printf("%s : %d time use %lu us \n", __func__, max,end - start); static unsigned

Re: Question about watchdog

2018-07-08 Thread valdis . kletnieks
On Sun, 08 Jul 2018 15:46:32 -0400, Ruben Safir said: > What are you saying? That is the filesystem bus sends a HW interupt on Error while parsing statement., What is a "filesystem bus" and when does it issue a HW interrupt? pgpAXjJvARBym.pgp Description: PGP signature

Re: Question about watchdog

2018-07-08 Thread Ruben Safir
On Mon, Jul 02, 2018 at 10:29:30AM +0200, Greg KH wrote: > On Mon, Jul 02, 2018 at 08:58:16AM +0100, Justin Skists wrote: > > > > > On 01 July 2018 at 13:44 bing zhu wrote: > > > > > > > > > Dear Sir/Ma'am > > > Thank you for your time ,i'm a student new to linux kernel.at present ,i'd > > >

Re: Question about memcpy

2018-07-08 Thread bing zhu
void *p = malloc(4096 * max); start = usec(); for (i = 0; i < max; i++) { memcpy(p + i * 4096, page, 4096); } end = usec(); printf("%s : %d time use %lu us \n", __func__, max,end - start); static unsigned long usec(void) { struct timeval tv; gettimeofday(, 0); return

Re: Question about memcpy

2018-07-07 Thread valdis . kletnieks
On Sat, 07 Jul 2018 19:36:47 +0800, bing zhu said: > and in user space i do the same thing,I noticed that kernel is faster than > user , How did you measure the times? Doing this right is actually harder than it looks... pgpT3oFpml7qt.pgp Description: PGP signature

Re: Question about memcpy

2018-07-07 Thread Alex Arvelaez
On Jul 7, 2018 7:37 AM, bing zhu wrote: > > Dear Sir/Ma'am > Thank you for your time ,i'm a student new to linux kernel. > I have a question about memcpy,i noticed that memcpy is faster in kernel than > in user space > for example : > in a module helloworld , i use m

Question about memcpy

2018-07-07 Thread bing zhu
Dear Sir/Ma'am Thank you for your time ,i'm a student new to linux kernel. I have a question about memcpy,i noticed that memcpy is faster in kernel than in user space for example : in a module helloworld , i use memcpy to copy a 4096B to a block of memory for like 1 times and in user space i

Re: Question about watchdog

2018-07-03 Thread valdis . kletnieks
On Tue, 03 Jul 2018 10:28:48 +0800, you said: > yes ! but there are days when people have to do a real-time work with no > delay in kernel space ,i think i can feed the dog > a percpu variable "nmi_touch" looks suspicious,thanks! 1) The Linux kernel community convention is t use 'reply all'

Re: Question about watchdog

2018-07-02 Thread valdis . kletnieks
On Sun, 01 Jul 2018 20:44:29 +0800, bing zhu said: > say use kthread_create func ,my question is :how can i make this thread to > run on a cpu and never get switched or scheduled , there is a > while(1).structure in that thread i need it to do work That's almost certainly a result of a poor

Re: Question about watchdog

2018-07-02 Thread Justin Skists
> On 02 July 2018 at 09:29 Greg KH wrote: > > > On Mon, Jul 02, 2018 at 08:58:16AM +0100, Justin Skists wrote: > > > > > On 01 July 2018 at 13:44 bing zhu wrote: > > > > > > > > > Dear Sir/Ma'am > > > Thank you for your time ,i'm a student new to linux kernel.at present ,i'd > > > like to

Re: Question about watchdog

2018-07-02 Thread Greg KH
On Mon, Jul 02, 2018 at 08:58:16AM +0100, Justin Skists wrote: > > > On 01 July 2018 at 13:44 bing zhu wrote: > > > > > > Dear Sir/Ma'am > > Thank you for your time ,i'm a student new to linux kernel.at present ,i'd > > like to create a kernel thread > > say use kthread_create func ,my

Re: Question about watchdog

2018-07-02 Thread Justin Skists
> On 01 July 2018 at 13:44 bing zhu wrote: > > > Dear Sir/Ma'am > Thank you for your time ,i'm a student new to linux kernel.at present ,i'd > like to create a kernel thread > say use kthread_create func ,my question is :how can i make this thread to > run on a cpu and never get switched or

Re: Question about watchdog

2018-07-01 Thread Ruben Safir
On 07/01/2018 08:44 AM, bing zhu wrote: > my question is :how can i make this thread to > run on a cpu and never get switched or scheduled , it is a preemptive multitasking kernel -- So many immigrant groups have swept through our town that Brooklyn, like Atlantis, reaches mythological

Question about watchdog

2018-07-01 Thread bing zhu
Dear Sir/Ma'am Thank you for your time ,i'm a student new to linux kernel.at present ,i'd like to create a kernel thread say use kthread_create func ,my question is :how can i make this thread to run on a cpu and never get switched or scheduled , there is a while(1).structure in that thread i

Re: Question about mmap

2018-06-15 Thread Mulyadi Santosa
On Mon, Jun 11, 2018 at 7:47 PM, bing zhu wrote: > Dear Sir/Ma'am > How can i map a kernel virtual address to a user process's same virtual > address ?is it possible ? > thank you for your time > best wishes! > > Dear Bing Just to clarify, what do you mean by "user process' same virtual

Re: Question about mmap

2018-06-12 Thread Seunguk Shin
ent: 6/11/2018 9:47:55 PM Subject: Question about mmap Dear Sir/Ma'am How can i map a kernel virtual address to a user process's same virtual address ?is it possible ? thank you for your time best wishes! ___ Kernelnewbies mailing list Kernelnewbies@k

Question about mmap

2018-06-11 Thread bing zhu
Dear Sir/Ma'am How can i map a kernel virtual address to a user process's same virtual address ?is it possible ? thank you for your time best wishes! ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org

Re: A question about function split_mem_range

2018-03-25 Thread valdis . kletnieks
On Sun, 25 Mar 2018 22:32:42 +0800, Hao Lee said: > In arch/x86/mm/init.c, there is a function called split_mem_range[0]. > Its logic is very complicated and I can't figure out what it does. I > have added some debug statements in this function to print all > variable, but I still can't

A question about function split_mem_range

2018-03-25 Thread Hao Lee
Hi, I'm currently reading the memory management source code and get stuck on a function. In arch/x86/mm/init.c, there is a function called split_mem_range[0]. Its logic is very complicated and I can't figure out what it does. I have added some debug statements in this function to print all

Re: A question about decompressing kernel on boot

2018-02-25 Thread ????
lt;kernelnewbies@kernelnewbies.org>; Subject: Re: A question about decompressing kernel on boot leaq(_bss-8)(%rip), %rsi leaq(_bss-8)(%rbx), %rdi movq$_bss /* - $startup_32 */, %rcx shrq$3, %rcx std rep movsq

Re: A question about decompressing kernel on boot

2018-02-25 Thread haolee.swjtu
leaq (_bss-8)(%rip), %rsi leaq (_bss-8)(%rbx), %rdi movq $_bss /* - $startup_32 */, %rcx shrq $3, %rcx std rep movsq cld The movsq instruction copys 8 bytes each time and for the first time it will copy [_bss-8, _bss) to the new location. If we don't minus 8, the data in [_bss,

A question about decompressing kernel on boot

2018-02-25 Thread ????
Hi list, In the source code arch/x86/boot/compressed/head_64.S, it described how compressed kernel is copied from the origin place to another pointed by rbx register. But I'm confused about the copying code, why it needs to minus 8 from _bss when calculating _bss original and new addresses.

Re: Question about uprobes

2017-04-07 Thread Mulyadi Santosa
On Thursday, April 6, 2017, W. Michael Petullo wrote: > >> I am writing some software that monitors a guest VM using > virtual-machine > >> introspection and "hijacks" system calls under certain conditions. For > >> example, the program might inject an int3/breakpoint into the

Re: Question about uprobes

2017-04-06 Thread W. Michael Petullo
>> I am writing some software that monitors a guest VM using virtual-machine >> introspection and "hijacks" system calls under certain conditions. For >> example, the program might inject an int3/breakpoint into the guest >> kernel at the entry point to sys_open. When the breakpoint is hit, the >>

Re: Question about uprobes

2017-04-06 Thread Mulyadi Santosa
On Thursday, April 6, 2017, W. Michael Petullo wrote: > I am writing some software that monitors a guest VM using virtual-machine > introspection and "hijacks" system calls under certain conditions. For > example, the program might inject an int3/breakpoint into the guest > kernel

Question about uprobes

2017-04-05 Thread W. Michael Petullo
I am writing some software that monitors a guest VM using virtual-machine introspection and "hijacks" system calls under certain conditions. For example, the program might inject an int3/breakpoint into the guest kernel at the entry point to sys_open. When the breakpoint is hit, the program might

Re: [mm subsystem] A question about function page_table_range_init_count()

2017-03-21 Thread Rik van Riel
On Wed, 2017-03-15 at 22:12 +0800, Hao Lee wrote: > Hi, all > > I encounter a problem when I read the source code of kernel 4.9.9. > > In arch/x86/mm/init_32.c, at line 125 [1], there is a function named > page_table_range_init_count(...). I have analyzed some codes and find > its two parameters

[mm subsystem] A question about function page_table_range_init_count()

2017-03-15 Thread Hao Lee
Hi, all I encounter a problem when I read the source code of kernel 4.9.9. In arch/x86/mm/init_32.c, at line 125 [1], there is a function named page_table_range_init_count(...). I have analyzed some codes and find its two parameters are PKMAP_BASE and FIXADDR_START. Between Line 141 and Line

question about nopage sample code

2017-02-22 Thread Ali Aminian
in ldd3 no page is implemented as the code posted below (page 428). can someone explain why should we subtract vma->vm_start? struct page *simple_vma_nopage(struct vm_area_struct *vma, unsigned long address, int *type) { struct page *pageptr; unsigned long offset =

Re: A question about priority search tree in kernel 2.6.24

2017-02-11 Thread Greg KH
On Sat, Feb 11, 2017 at 11:42:39PM +0800, Hao Lee wrote: > Hi, all > > Recently I'm reading "Professional Linux Kernel Architecture" while > referencing > the source code of kernel 2.6.24 and I have a question about priority search > tree. 2.6.24 is _very_

A question about priority search tree in kernel 2.6.24

2017-02-11 Thread Hao Lee
Hi, all Recently I'm reading "Professional Linux Kernel Architecture" while referencing the source code of kernel 2.6.24 and I have a question about priority search tree. In prio_tree_init function ( http://lxr.free-electrons.com/source/lib/prio_tree.c?v=2.6.24#L7

Question about object-based reverse mapping

2017-01-01 Thread Hao Lee
Hi, all I'm currently reading "Understanding the Linux Kernel (3rd)" and I have a question about "object-based reverse mapping". This is the Figure 17-1 on page 683 : http://imgur.com/R0OtIJh As this figure shows, many vm_area_struct are in the anon_vma’s list and they sh

Re: A question about kprobe/kretprobe and kmalloc/kzalloc

2016-12-21 Thread zerons
Sorry, I thought I solved the problem. Using `kzalloc` doesn't work all the time, I need to add `sleep(1)` in the test case after each syscall, like perf_event_open(...); sleep(1); ioctl(...); sleep(1); ioctl(...); sleep(1); read(...); I have tried these: 1) with `sleep(1)`, both kprobe and

A question about kprobe/kretprobe and kmalloc/kzalloc

2016-12-21 Thread zerons
Hi everyone. I wrote a kernel module to test something. The module uses kprobe and kretprobe, here is a bug I met today. The pre_handler of kprobe, calls `do_something`. The probed instructions are in the middle of a function. The entry_handler of kretprobe, also calls `do_something`.

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

Re: Fwd: Question about arp caches

2016-11-30 Thread Yisu Peng
: FYI -- Forwarded message - From: Anupam Kapoor <anupam.kap...@gmail.com <mailto: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 <mailto:yisup...@gmail.com>> ​On Tue,

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 Shawn Peng
I find a lot references of the function neigh_release(), can you direct me to the one that releases a staled arp entry? Thanks. On 11/29/2016 12:50 AM, Anupam Kapoor wrote: On Tue, Nov 29, 2016 at 10:40 AM, Shawn Peng > wrote: I'm reading

  1   2   3   >