vmalloc

Freeing (vfree-ing) pointer to volatile data

若如初见. 提交于 2019-12-31 04:06:26
问题 volatile seems to be a never ending question of every one. I thought I knew everything about it, but then I encountered this: So, I have a piece of memory shared between threads and I defined it like this: volatile type *name; If it makes you feel better, you can imagine type is just an int . This means I have a pointer (that is not volatile) to some data that are volatile. So, for example when it comes to optimizing, the compiler can cache the value of name but not name[0] . Am I right? So,

understanding the physical and virtual memory layout in my kernel

大憨熊 提交于 2019-12-12 14:21:35
问题 I have a dragonboard410c which is based on arm64 and when it boots , it shows the memory layout: software IO TLB [mem 0xb6c00000-0xbac00000] (64MB) mapped at [ff] Memory: 780212K/951296K available (9940K kernel code, 1294K rwda) Virtual kernel memory layout: vmalloc : 0xffffff8000000000 - 0xffffffbdbfff0000 ( 246 ) vmemmap : 0xffffffbdc0000000 - 0xffffffbfc0000000 ( 8 ) 0xffffffbdc0000000 - 0xffffffbdc1000000 ( 16 ) fixed : 0xffffffbffa7fd000 - 0xffffffbffac00000 ( 4108 ) PCI I/O :

Freeing (vfree-ing) pointer to volatile data

左心房为你撑大大i 提交于 2019-12-02 07:16:55
volatile seems to be a never ending question of every one. I thought I knew everything about it, but then I encountered this: So, I have a piece of memory shared between threads and I defined it like this: volatile type *name; If it makes you feel better, you can imagine type is just an int . This means I have a pointer (that is not volatile) to some data that are volatile. So, for example when it comes to optimizing, the compiler can cache the value of name but not name[0] . Am I right? So, now I am vfree ing this pointer (it's in a Linux kernel module) and it tells me that vfree expects

vmalloc_to_pfn returns 32 bit address on Linux 32 system. Why does it chop off higher bits of PAE physical address?

若如初见. 提交于 2019-12-01 22:03:21
问题 I'm using vmalloc_to_pfn() to get the physical address on a 32-bit PAE Linux system. It looks like vmalloc_to_pfn() returns "unsigned long" which means it is 32 bit on a 32 bit system, 64 bit on a 64-bit system. On 64-bit Linux, unsigned long is 64 bit and I've no issues. Problem: Using this function to convert virtual to physical: VA: 0xf8ab87fc PA using vmalloc_to_pfn: 0x36f7f7fc . But I'm actually expecting: 0x136f7f7fc . The physical address falls between 4 to 5 GB. But I can't get the

vmalloc_to_pfn returns 32 bit address on Linux 32 system. Why does it chop off higher bits of PAE physical address?

五迷三道 提交于 2019-12-01 20:08:04
I'm using vmalloc_to_pfn() to get the physical address on a 32-bit PAE Linux system. It looks like vmalloc_to_pfn() returns "unsigned long" which means it is 32 bit on a 32 bit system, 64 bit on a 64-bit system. On 64-bit Linux, unsigned long is 64 bit and I've no issues. Problem: Using this function to convert virtual to physical: VA: 0xf8ab87fc PA using vmalloc_to_pfn: 0x36f7f7fc . But I'm actually expecting: 0x136f7f7fc . The physical address falls between 4 to 5 GB. But I can't get the exact physical address, I only get the chopped off 32-bit address. Is there another way to get true

What is the difference between vmalloc and kmalloc?

断了今生、忘了曾经 提交于 2019-11-26 16:56:21
I've googled around and found most people advocating the use of kmalloc , as you're guaranteed to get contiguous physical blocks of memory. However, it also seems as though kmalloc can fail if a contiguous physical block that you want can't be found. What are the advantages of having a contiguous block of memory? Specifically, why would I need to have a contiguous physical block of memory in a system call ? Is there any reason I couldn't just use vmalloc ? Finally, if I were to allocate memory during the handling of a system call, should I specify GFP_ATOMIC ? Is a system call executed in an

What is the difference between vmalloc and kmalloc?

寵の児 提交于 2019-11-26 06:05:09
问题 I\'ve googled around and found most people advocating the use of kmalloc , as you\'re guaranteed to get contiguous physical blocks of memory. However, it also seems as though kmalloc can fail if a contiguous physical block that you want can\'t be found. What are the advantages of having a contiguous block of memory? Specifically, why would I need to have a contiguous physical block of memory in a system call ? Is there any reason I couldn\'t just use vmalloc ? Finally, if I were to allocate