Re: [RFC PATCH 08/12] mm: use mirrorable to switch allocate mirrored memory

2015-06-12 Thread Naoya Horiguchi
On Thu, Jun 04, 2015 at 09:02:49PM +0800, Xishi Qiu wrote:
> Add a new interface in path /proc/sys/vm/mirrorable. When set to 1, it means
> we should allocate mirrored memory for both user and kernel processes.

As Dave and Kamezawa-san commented, documentation is not enough, so please
add a section in Documentation/sysctl/vm.txt for this new tuning parameter.

Thanks,
Naoya Horiguchi

> 
> Signed-off-by: Xishi Qiu 
> ---
>  include/linux/mmzone.h | 1 +
>  kernel/sysctl.c| 9 +
>  mm/page_alloc.c| 1 +
>  3 files changed, 11 insertions(+)
> 
> diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
> index f82e3ae..20888dd 100644
> --- a/include/linux/mmzone.h
> +++ b/include/linux/mmzone.h
> @@ -85,6 +85,7 @@ struct mirror_info {
>  };
>  
>  extern struct mirror_info mirror_info;
> +extern int sysctl_mirrorable;
>  #  define is_migrate_mirror(migratetype) unlikely((migratetype) == 
> MIGRATE_MIRROR)
>  #else
>  #  define is_migrate_mirror(migratetype) false
> diff --git a/kernel/sysctl.c b/kernel/sysctl.c
> index 2082b1a..dc2625e 100644
> --- a/kernel/sysctl.c
> +++ b/kernel/sysctl.c
> @@ -1514,6 +1514,15 @@ static struct ctl_table vm_table[] = {
>   .extra2 = ,
>   },
>  #endif
> +#ifdef CONFIG_MEMORY_MIRROR
> + {
> + .procname   = "mirrorable",
> + .data   = _mirrorable,
> + .maxlen = sizeof(sysctl_mirrorable),
> + .mode   = 0644,
> + .proc_handler   = proc_dointvec_minmax,
> + },
> +#endif
>   {
>   .procname   = "user_reserve_kbytes",
>   .data   = _user_reserve_kbytes,
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index 249a8f6..63b90ca 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -212,6 +212,7 @@ int user_min_free_kbytes = -1;
>  
>  #ifdef CONFIG_MEMORY_MIRROR
>  struct mirror_info mirror_info;
> +int sysctl_mirrorable = 0;
>  #endif
>  
>  static unsigned long __meminitdata nr_kernel_pages;
> -- 
> 2.0.0
> 
> 
> --
> To unsubscribe, send a message with 'unsubscribe linux-mm' in
> the body to majord...@kvack.org.  For more info on Linux MM,
> see: http://www.linux-mm.org/ .
> Don't email: mailto:"d...@kvack.org;> em...@kvack.org --
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [RFC PATCH 08/12] mm: use mirrorable to switch allocate mirrored memory

2015-06-12 Thread Naoya Horiguchi
On Thu, Jun 04, 2015 at 09:02:49PM +0800, Xishi Qiu wrote:
 Add a new interface in path /proc/sys/vm/mirrorable. When set to 1, it means
 we should allocate mirrored memory for both user and kernel processes.

As Dave and Kamezawa-san commented, documentation is not enough, so please
add a section in Documentation/sysctl/vm.txt for this new tuning parameter.

Thanks,
Naoya Horiguchi

 
 Signed-off-by: Xishi Qiu qiuxi...@huawei.com
 ---
  include/linux/mmzone.h | 1 +
  kernel/sysctl.c| 9 +
  mm/page_alloc.c| 1 +
  3 files changed, 11 insertions(+)
 
 diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
 index f82e3ae..20888dd 100644
 --- a/include/linux/mmzone.h
 +++ b/include/linux/mmzone.h
 @@ -85,6 +85,7 @@ struct mirror_info {
  };
  
  extern struct mirror_info mirror_info;
 +extern int sysctl_mirrorable;
  #  define is_migrate_mirror(migratetype) unlikely((migratetype) == 
 MIGRATE_MIRROR)
  #else
  #  define is_migrate_mirror(migratetype) false
 diff --git a/kernel/sysctl.c b/kernel/sysctl.c
 index 2082b1a..dc2625e 100644
 --- a/kernel/sysctl.c
 +++ b/kernel/sysctl.c
 @@ -1514,6 +1514,15 @@ static struct ctl_table vm_table[] = {
   .extra2 = one,
   },
  #endif
 +#ifdef CONFIG_MEMORY_MIRROR
 + {
 + .procname   = mirrorable,
 + .data   = sysctl_mirrorable,
 + .maxlen = sizeof(sysctl_mirrorable),
 + .mode   = 0644,
 + .proc_handler   = proc_dointvec_minmax,
 + },
 +#endif
   {
   .procname   = user_reserve_kbytes,
   .data   = sysctl_user_reserve_kbytes,
 diff --git a/mm/page_alloc.c b/mm/page_alloc.c
 index 249a8f6..63b90ca 100644
 --- a/mm/page_alloc.c
 +++ b/mm/page_alloc.c
 @@ -212,6 +212,7 @@ int user_min_free_kbytes = -1;
  
  #ifdef CONFIG_MEMORY_MIRROR
  struct mirror_info mirror_info;
 +int sysctl_mirrorable = 0;
  #endif
  
  static unsigned long __meminitdata nr_kernel_pages;
 -- 
 2.0.0
 
 
 --
 To unsubscribe, send a message with 'unsubscribe linux-mm' in
 the body to majord...@kvack.org.  For more info on Linux MM,
 see: http://www.linux-mm.org/ .
 Don't email: a href=mailto:d...@kvack.org; em...@kvack.org /a--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [RFC PATCH 08/12] mm: use mirrorable to switch allocate mirrored memory

2015-06-09 Thread Kamezawa Hiroyuki

On 2015/06/09 19:09, Xishi Qiu wrote:

On 2015/6/9 15:06, Kamezawa Hiroyuki wrote:


On 2015/06/04 22:02, Xishi Qiu wrote:

Add a new interface in path /proc/sys/vm/mirrorable. When set to 1, it means
we should allocate mirrored memory for both user and kernel processes.

Signed-off-by: Xishi Qiu 


I can't see why do we need this switch. If this is set, all GFP_HIGHUSER will 
use
mirrored memory ?

Or will you add special MMAP/madvise flag to use mirrored memory ?



Hi Kame,

Yes,

MMAP/madvise
-> add VM_MIRROR
-> add GFP_MIRROR
-> use MIGRATE_MIRROR list to alloc mirrored pages

So user can use mirrored memory. What do you think?



I see. please explain it (your final plan) in patch description or in cover 
page of patches.

Thanks,
-Kame


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [RFC PATCH 08/12] mm: use mirrorable to switch allocate mirrored memory

2015-06-09 Thread Xishi Qiu
On 2015/6/9 15:06, Kamezawa Hiroyuki wrote:

> On 2015/06/04 22:02, Xishi Qiu wrote:
>> Add a new interface in path /proc/sys/vm/mirrorable. When set to 1, it means
>> we should allocate mirrored memory for both user and kernel processes.
>>
>> Signed-off-by: Xishi Qiu 
> 
> I can't see why do we need this switch. If this is set, all GFP_HIGHUSER will 
> use
> mirrored memory ?
> 
> Or will you add special MMAP/madvise flag to use mirrored memory ?
> 

Hi Kame,

Yes, 

MMAP/madvise 
-> add VM_MIRROR 
-> add GFP_MIRROR
-> use MIGRATE_MIRROR list to alloc mirrored pages

So user can use mirrored memory. What do you think?

Thanks,
Xishi Qiu

> Thanks,
> -Kame
> 
>> ---
>>   include/linux/mmzone.h | 1 +
>>   kernel/sysctl.c| 9 +
>>   mm/page_alloc.c| 1 +
>>   3 files changed, 11 insertions(+)
>>
>> diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
>> index f82e3ae..20888dd 100644
>> --- a/include/linux/mmzone.h
>> +++ b/include/linux/mmzone.h
>> @@ -85,6 +85,7 @@ struct mirror_info {
>>   };
>>
>>   extern struct mirror_info mirror_info;
>> +extern int sysctl_mirrorable;
>>   #  define is_migrate_mirror(migratetype) unlikely((migratetype) == 
>> MIGRATE_MIRROR)
>>   #else
>>   #  define is_migrate_mirror(migratetype) false
>> diff --git a/kernel/sysctl.c b/kernel/sysctl.c
>> index 2082b1a..dc2625e 100644
>> --- a/kernel/sysctl.c
>> +++ b/kernel/sysctl.c
>> @@ -1514,6 +1514,15 @@ static struct ctl_table vm_table[] = {
>>   .extra2= ,
>>   },
>>   #endif
>> +#ifdef CONFIG_MEMORY_MIRROR
>> +{
>> +.procname= "mirrorable",
>> +.data= _mirrorable,
>> +.maxlen= sizeof(sysctl_mirrorable),
>> +.mode= 0644,
>> +.proc_handler= proc_dointvec_minmax,
>> +},
>> +#endif
>>   {
>>   .procname= "user_reserve_kbytes",
>>   .data= _user_reserve_kbytes,
>> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
>> index 249a8f6..63b90ca 100644
>> --- a/mm/page_alloc.c
>> +++ b/mm/page_alloc.c
>> @@ -212,6 +212,7 @@ int user_min_free_kbytes = -1;
>>
>>   #ifdef CONFIG_MEMORY_MIRROR
>>   struct mirror_info mirror_info;
>> +int sysctl_mirrorable = 0;
>>   #endif
>>
>>   static unsigned long __meminitdata nr_kernel_pages;
>>
> 
> 
> 
> .
> 



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [RFC PATCH 08/12] mm: use mirrorable to switch allocate mirrored memory

2015-06-09 Thread Kamezawa Hiroyuki

On 2015/06/04 22:02, Xishi Qiu wrote:

Add a new interface in path /proc/sys/vm/mirrorable. When set to 1, it means
we should allocate mirrored memory for both user and kernel processes.

Signed-off-by: Xishi Qiu 


I can't see why do we need this switch. If this is set, all GFP_HIGHUSER will 
use
mirrored memory ?

Or will you add special MMAP/madvise flag to use mirrored memory ?

Thanks,
-Kame


---
  include/linux/mmzone.h | 1 +
  kernel/sysctl.c| 9 +
  mm/page_alloc.c| 1 +
  3 files changed, 11 insertions(+)

diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index f82e3ae..20888dd 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -85,6 +85,7 @@ struct mirror_info {
  };

  extern struct mirror_info mirror_info;
+extern int sysctl_mirrorable;
  #  define is_migrate_mirror(migratetype) unlikely((migratetype) == 
MIGRATE_MIRROR)
  #else
  #  define is_migrate_mirror(migratetype) false
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 2082b1a..dc2625e 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -1514,6 +1514,15 @@ static struct ctl_table vm_table[] = {
.extra2 = ,
},
  #endif
+#ifdef CONFIG_MEMORY_MIRROR
+   {
+   .procname   = "mirrorable",
+   .data   = _mirrorable,
+   .maxlen = sizeof(sysctl_mirrorable),
+   .mode   = 0644,
+   .proc_handler   = proc_dointvec_minmax,
+   },
+#endif
{
.procname   = "user_reserve_kbytes",
.data   = _user_reserve_kbytes,
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 249a8f6..63b90ca 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -212,6 +212,7 @@ int user_min_free_kbytes = -1;

  #ifdef CONFIG_MEMORY_MIRROR
  struct mirror_info mirror_info;
+int sysctl_mirrorable = 0;
  #endif

  static unsigned long __meminitdata nr_kernel_pages;




--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [RFC PATCH 08/12] mm: use mirrorable to switch allocate mirrored memory

2015-06-09 Thread Xishi Qiu
On 2015/6/9 15:06, Kamezawa Hiroyuki wrote:

 On 2015/06/04 22:02, Xishi Qiu wrote:
 Add a new interface in path /proc/sys/vm/mirrorable. When set to 1, it means
 we should allocate mirrored memory for both user and kernel processes.

 Signed-off-by: Xishi Qiu qiuxi...@huawei.com
 
 I can't see why do we need this switch. If this is set, all GFP_HIGHUSER will 
 use
 mirrored memory ?
 
 Or will you add special MMAP/madvise flag to use mirrored memory ?
 

Hi Kame,

Yes, 

MMAP/madvise 
- add VM_MIRROR 
- add GFP_MIRROR
- use MIGRATE_MIRROR list to alloc mirrored pages

So user can use mirrored memory. What do you think?

Thanks,
Xishi Qiu

 Thanks,
 -Kame
 
 ---
   include/linux/mmzone.h | 1 +
   kernel/sysctl.c| 9 +
   mm/page_alloc.c| 1 +
   3 files changed, 11 insertions(+)

 diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
 index f82e3ae..20888dd 100644
 --- a/include/linux/mmzone.h
 +++ b/include/linux/mmzone.h
 @@ -85,6 +85,7 @@ struct mirror_info {
   };

   extern struct mirror_info mirror_info;
 +extern int sysctl_mirrorable;
   #  define is_migrate_mirror(migratetype) unlikely((migratetype) == 
 MIGRATE_MIRROR)
   #else
   #  define is_migrate_mirror(migratetype) false
 diff --git a/kernel/sysctl.c b/kernel/sysctl.c
 index 2082b1a..dc2625e 100644
 --- a/kernel/sysctl.c
 +++ b/kernel/sysctl.c
 @@ -1514,6 +1514,15 @@ static struct ctl_table vm_table[] = {
   .extra2= one,
   },
   #endif
 +#ifdef CONFIG_MEMORY_MIRROR
 +{
 +.procname= mirrorable,
 +.data= sysctl_mirrorable,
 +.maxlen= sizeof(sysctl_mirrorable),
 +.mode= 0644,
 +.proc_handler= proc_dointvec_minmax,
 +},
 +#endif
   {
   .procname= user_reserve_kbytes,
   .data= sysctl_user_reserve_kbytes,
 diff --git a/mm/page_alloc.c b/mm/page_alloc.c
 index 249a8f6..63b90ca 100644
 --- a/mm/page_alloc.c
 +++ b/mm/page_alloc.c
 @@ -212,6 +212,7 @@ int user_min_free_kbytes = -1;

   #ifdef CONFIG_MEMORY_MIRROR
   struct mirror_info mirror_info;
 +int sysctl_mirrorable = 0;
   #endif

   static unsigned long __meminitdata nr_kernel_pages;

 
 
 
 .
 



--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [RFC PATCH 08/12] mm: use mirrorable to switch allocate mirrored memory

2015-06-09 Thread Kamezawa Hiroyuki

On 2015/06/04 22:02, Xishi Qiu wrote:

Add a new interface in path /proc/sys/vm/mirrorable. When set to 1, it means
we should allocate mirrored memory for both user and kernel processes.

Signed-off-by: Xishi Qiu qiuxi...@huawei.com


I can't see why do we need this switch. If this is set, all GFP_HIGHUSER will 
use
mirrored memory ?

Or will you add special MMAP/madvise flag to use mirrored memory ?

Thanks,
-Kame


---
  include/linux/mmzone.h | 1 +
  kernel/sysctl.c| 9 +
  mm/page_alloc.c| 1 +
  3 files changed, 11 insertions(+)

diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index f82e3ae..20888dd 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -85,6 +85,7 @@ struct mirror_info {
  };

  extern struct mirror_info mirror_info;
+extern int sysctl_mirrorable;
  #  define is_migrate_mirror(migratetype) unlikely((migratetype) == 
MIGRATE_MIRROR)
  #else
  #  define is_migrate_mirror(migratetype) false
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 2082b1a..dc2625e 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -1514,6 +1514,15 @@ static struct ctl_table vm_table[] = {
.extra2 = one,
},
  #endif
+#ifdef CONFIG_MEMORY_MIRROR
+   {
+   .procname   = mirrorable,
+   .data   = sysctl_mirrorable,
+   .maxlen = sizeof(sysctl_mirrorable),
+   .mode   = 0644,
+   .proc_handler   = proc_dointvec_minmax,
+   },
+#endif
{
.procname   = user_reserve_kbytes,
.data   = sysctl_user_reserve_kbytes,
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 249a8f6..63b90ca 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -212,6 +212,7 @@ int user_min_free_kbytes = -1;

  #ifdef CONFIG_MEMORY_MIRROR
  struct mirror_info mirror_info;
+int sysctl_mirrorable = 0;
  #endif

  static unsigned long __meminitdata nr_kernel_pages;




--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [RFC PATCH 08/12] mm: use mirrorable to switch allocate mirrored memory

2015-06-09 Thread Kamezawa Hiroyuki

On 2015/06/09 19:09, Xishi Qiu wrote:

On 2015/6/9 15:06, Kamezawa Hiroyuki wrote:


On 2015/06/04 22:02, Xishi Qiu wrote:

Add a new interface in path /proc/sys/vm/mirrorable. When set to 1, it means
we should allocate mirrored memory for both user and kernel processes.

Signed-off-by: Xishi Qiu qiuxi...@huawei.com


I can't see why do we need this switch. If this is set, all GFP_HIGHUSER will 
use
mirrored memory ?

Or will you add special MMAP/madvise flag to use mirrored memory ?



Hi Kame,

Yes,

MMAP/madvise
- add VM_MIRROR
- add GFP_MIRROR
- use MIGRATE_MIRROR list to alloc mirrored pages

So user can use mirrored memory. What do you think?



I see. please explain it (your final plan) in patch description or in cover 
page of patches.

Thanks,
-Kame


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [RFC PATCH 08/12] mm: use mirrorable to switch allocate mirrored memory

2015-06-04 Thread Xishi Qiu
On 2015/6/5 2:41, Dave Hansen wrote:

> On 06/04/2015 06:02 AM, Xishi Qiu wrote:
>> Add a new interface in path /proc/sys/vm/mirrorable. When set to 1, it means
>> we should allocate mirrored memory for both user and kernel processes.
> 
> That's a pretty dangerously short name. :)
> 

Hi Dave,

Thanks for your comment. I'm not sure whether we should add this interface
for user processes. However some important userspace(e.g. /bin/init, key
business like datebase) may be want mirrored memory to improve reliability.

If we want this interface, I think the code need more change.

Thanks,
Xishi Qiu

> How would this end up getting used?  It seems like it would be dangerous
> to use once userspace was very far along.  So would the kernel set it to
> 1 and then let (early??) userspace set it back to 0?  That would let
> important userspace like /bin/init get mirrored memory without having to
> actually change much in userspace.
> 
> This definitely needs some good documentation.
> 
> Also, if it's insane to turn it back *on*, maybe it should be a one-way
> trip to turn off.
> 
> .
> 



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [RFC PATCH 08/12] mm: use mirrorable to switch allocate mirrored memory

2015-06-04 Thread Dave Hansen
On 06/04/2015 06:02 AM, Xishi Qiu wrote:
> Add a new interface in path /proc/sys/vm/mirrorable. When set to 1, it means
> we should allocate mirrored memory for both user and kernel processes.

That's a pretty dangerously short name. :)

How would this end up getting used?  It seems like it would be dangerous
to use once userspace was very far along.  So would the kernel set it to
1 and then let (early??) userspace set it back to 0?  That would let
important userspace like /bin/init get mirrored memory without having to
actually change much in userspace.

This definitely needs some good documentation.

Also, if it's insane to turn it back *on*, maybe it should be a one-way
trip to turn off.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [RFC PATCH 08/12] mm: use mirrorable to switch allocate mirrored memory

2015-06-04 Thread Luck, Tony
> Add a new interface in path /proc/sys/vm/mirrorable. When set to 1, it means
> we should allocate mirrored memory for both user and kernel processes.

With some "to be defined later" mechanism for how the user requests mirror vs.
not mirror.  Plus some capability/ulimit pieces that restrict who can do this 
and how
much they can get???

-Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [RFC PATCH 08/12] mm: use mirrorable to switch allocate mirrored memory

2015-06-04 Thread Xishi Qiu
On 2015/6/5 2:41, Dave Hansen wrote:

 On 06/04/2015 06:02 AM, Xishi Qiu wrote:
 Add a new interface in path /proc/sys/vm/mirrorable. When set to 1, it means
 we should allocate mirrored memory for both user and kernel processes.
 
 That's a pretty dangerously short name. :)
 

Hi Dave,

Thanks for your comment. I'm not sure whether we should add this interface
for user processes. However some important userspace(e.g. /bin/init, key
business like datebase) may be want mirrored memory to improve reliability.

If we want this interface, I think the code need more change.

Thanks,
Xishi Qiu

 How would this end up getting used?  It seems like it would be dangerous
 to use once userspace was very far along.  So would the kernel set it to
 1 and then let (early??) userspace set it back to 0?  That would let
 important userspace like /bin/init get mirrored memory without having to
 actually change much in userspace.
 
 This definitely needs some good documentation.
 
 Also, if it's insane to turn it back *on*, maybe it should be a one-way
 trip to turn off.
 
 .
 



--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [RFC PATCH 08/12] mm: use mirrorable to switch allocate mirrored memory

2015-06-04 Thread Dave Hansen
On 06/04/2015 06:02 AM, Xishi Qiu wrote:
 Add a new interface in path /proc/sys/vm/mirrorable. When set to 1, it means
 we should allocate mirrored memory for both user and kernel processes.

That's a pretty dangerously short name. :)

How would this end up getting used?  It seems like it would be dangerous
to use once userspace was very far along.  So would the kernel set it to
1 and then let (early??) userspace set it back to 0?  That would let
important userspace like /bin/init get mirrored memory without having to
actually change much in userspace.

This definitely needs some good documentation.

Also, if it's insane to turn it back *on*, maybe it should be a one-way
trip to turn off.
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [RFC PATCH 08/12] mm: use mirrorable to switch allocate mirrored memory

2015-06-04 Thread Luck, Tony
 Add a new interface in path /proc/sys/vm/mirrorable. When set to 1, it means
 we should allocate mirrored memory for both user and kernel processes.

With some to be defined later mechanism for how the user requests mirror vs.
not mirror.  Plus some capability/ulimit pieces that restrict who can do this 
and how
much they can get???

-Tony
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/