Kernel Newbies archive on lore.kernel.org
 help / color / Atom feed
* Is there some method or software that could purposely generate a lot of physical memory fragmentations on linux?
@ 2020-06-30  6:51 孙世龙 sunshilong
  2020-07-02  8:29 ` Mulyadi Santosa
  2020-07-03  5:20 ` 孙世龙 sunshilong
  0 siblings, 2 replies; 4+ messages in thread
From: 孙世龙 sunshilong @ 2020-06-30  6:51 UTC (permalink / raw)
  To: Kernelnewbies

Hi, list
      Is there some method or software that could purposely generate a lot
of physical memory fragmentations on Linux?

     I need to do some tests under such circumstances.

    Thank you for your attention to this matter.

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Is there some method or software that could purposely generate a lot of physical memory fragmentations on linux?
  2020-06-30  6:51 Is there some method or software that could purposely generate a lot of physical memory fragmentations on linux? 孙世龙 sunshilong
@ 2020-07-02  8:29 ` Mulyadi Santosa
  2020-07-03  4:58   ` Valdis Klētnieks
  2020-07-03  5:20 ` 孙世龙 sunshilong
  1 sibling, 1 reply; 4+ messages in thread
From: Mulyadi Santosa @ 2020-07-02  8:29 UTC (permalink / raw)
  To: kernelnewbies

[-- Attachment #1.1: Type: text/plain, Size: 917 bytes --]

On Tue, Jun 30, 2020 at 1:52 PM 孙世龙 sunshilong <sunshilong369@gmail.com>
wrote:

> Hi, list
>       Is there some method or software that could purposely generate a lot
> of physical memory fragmentations on Linux?
>
>      I need to do some tests under such circumstances.
>
>     Thank you for your attention to this matter.
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>

Hi

Just pseudo idea, if this is in user space, try to:  allocate many blocks
of memory using malloc, each having different size, keep the returned
pointer, then randomly free() some of them, then malloc() again with
different size
-- 
regards,

Mulyadi Santosa
Freelance Linux trainer and consultant

blog: the-hydra.blogspot.com
training: mulyaditraining.blogspot.com

[-- Attachment #1.2: Type: text/html, Size: 1698 bytes --]

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Is there some method or software that could purposely generate a lot of physical memory fragmentations on linux?
  2020-07-02  8:29 ` Mulyadi Santosa
@ 2020-07-03  4:58   ` Valdis Klētnieks
  0 siblings, 0 replies; 4+ messages in thread
From: Valdis Klētnieks @ 2020-07-03  4:58 UTC (permalink / raw)
  To: Mulyadi Santosa; +Cc: kernelnewbies

[-- Attachment #1.1: Type: text/plain, Size: 577 bytes --]

On Thu, 02 Jul 2020 15:29:18 +0700, Mulyadi Santosa said:

> Just pseudo idea, if this is in user space, try to:  allocate many blocks
> of memory using malloc, each having different size, keep the returned
> pointer, then randomly free() some of them, then malloc() again with
> different size

That will cause userspace malloc() to have fragmentation, but as far
as the kernel is concerned it's all just 4K pages of user memory.

Causing physical memory fragmentation will require abusing the kernel
memory allocators such as kmalloc() and vmalloc() and friends.

[-- Attachment #1.2: Type: application/pgp-signature, Size: 832 bytes --]

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Is there some method or software that could purposely generate a lot of physical memory fragmentations on linux?
  2020-06-30  6:51 Is there some method or software that could purposely generate a lot of physical memory fragmentations on linux? 孙世龙 sunshilong
  2020-07-02  8:29 ` Mulyadi Santosa
@ 2020-07-03  5:20 ` 孙世龙 sunshilong
  1 sibling, 0 replies; 4+ messages in thread
From: 孙世龙 sunshilong @ 2020-07-03  5:20 UTC (permalink / raw)
  To: Kernelnewbies, Valdis Klētnieks, mulyadi.santosa

[-- Attachment #1.1: Type: text/plain, Size: 884 bytes --]

Hi, Valdis Klētnieks, Mulyadi Santosa

Thanks to both of you.
>> Just pseudo idea, if this is in user space, try to:  allocate many blocks
>> of memory using malloc, each having different size, keep the returned
>> pointer, then randomly free() some of them, then malloc() again with
>> different size

>That will cause userspace malloc() to have fragmentation, but as far
>as the kernel is concerned it's all just 4K pages of user memory.
>Causing physical memory fragmentation will require abusing the kernel
>memory allocators such as kmalloc() and vmalloc() and friends.

I fully understand what you mean by "cause userspace malloc() to have
fragmentation".
I am sorry, maybe I mislead you. I just want there are no available free
high order blocks(i.e
32KB,64KB, 128KB and etc) on the platform.
How can I more efficiently and automatically achieve this goal?

[-- Attachment #1.2: Type: text/html, Size: 1011 bytes --]

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-30  6:51 Is there some method or software that could purposely generate a lot of physical memory fragmentations on linux? 孙世龙 sunshilong
2020-07-02  8:29 ` Mulyadi Santosa
2020-07-03  4:58   ` Valdis Klētnieks
2020-07-03  5:20 ` 孙世龙 sunshilong

Kernel Newbies archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/kernelnewbies/0 kernelnewbies/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 kernelnewbies kernelnewbies/ https://lore.kernel.org/kernelnewbies \
		kernelnewbies@kernelnewbies.org
	public-inbox-index kernelnewbies

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernelnewbies.kernelnewbies


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git