Re: [RFT][PATCH 3/3] swsusp: improve freeing of memory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi!

> This patch makes swsusp free only as much memory as needed and not as much
> as possible.

Looks okay to me. ACK, modulo few small things.

> -
>  /* References to section boundaries */
>  extern const void __nosave_begin, __nosave_end;
>  
>  extern unsigned int nr_copy_pages;
> -extern suspend_pagedir_t *pagedir_nosave;
> -extern suspend_pagedir_t *pagedir_save;
> +extern struct pbe *pagedir_nosave;
> +
> +/*
> + * This compilation switch determines the way in which memory will be freed
> + * during suspend.  If defined, only as much memory will be freed as needed
> + * to complete the suspend.  Otherwise, the largest possible amount of memory
> + * will be freed.
> + */
> +#define OPPORTUNISTIC_SHRINKING		1

Can you use little less tabelators? Also shorter name for this one
might be "FREE_ALL". 

> +/*
> + * During suspend, on each attempt to free some more memory SHRINK_BITE
> + * is used as the number of pages to free
> + */
> +#define SHRINK_BITE	10000

Does this really need this kind of visibility? There's nothing user
should tweak here.

>  /**
> + *	On resume it is necessary to trace and eventually free the unsafe
> + *	pages that have been allocated, because they are needed for I/O
> + *	(on x86-64 we likely will "eat" these pages once again while
> + *	creating the temporary page translation tables)
> + */
> +
> +struct eaten_page {
> +	struct eaten_page	*next;
> +	char			padding[PAGE_SIZE - sizeof(void *)];
> +};

Less tabelators here, please...

-- 
Thanks, Sharp!
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux