All of lore.kernel.org
 help / color / mirror / Atom feed
* si_swapinfo export
@ 2011-09-02 15:41 George Shuklin
  2011-09-02 16:18 ` Christoph Lameter
  2011-09-02 19:53 ` Valdis.Kletnieks
  0 siblings, 2 replies; 4+ messages in thread
From: George Shuklin @ 2011-09-02 15:41 UTC (permalink / raw)
  To: linux-kernel

Good day.

Why si_swapinfo (from include/linux/swap.h) is not marked as
EXPORT_SYMBOL_GPL? It's kinda hard to gain information about memory in
module. 

/proc/meminfo Contain more information than module can gain without
special tricks...

Thanks.


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

* Re: si_swapinfo export
  2011-09-02 15:41 si_swapinfo export George Shuklin
@ 2011-09-02 16:18 ` Christoph Lameter
  2011-09-02 19:53 ` Valdis.Kletnieks
  1 sibling, 0 replies; 4+ messages in thread
From: Christoph Lameter @ 2011-09-02 16:18 UTC (permalink / raw)
  To: George Shuklin; +Cc: linux-kernel

On Fri, 2 Sep 2011, George Shuklin wrote:

> Why si_swapinfo (from include/linux/swap.h) is not marked as
> EXPORT_SYMBOL_GPL? It's kinda hard to gain information about memory in
> module.

No one needed it from a module so far.

Submit your code with a patch that exports si_swapinfo if you need it.


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

* Re: si_swapinfo export
  2011-09-02 15:41 si_swapinfo export George Shuklin
  2011-09-02 16:18 ` Christoph Lameter
@ 2011-09-02 19:53 ` Valdis.Kletnieks
  2011-09-03  0:52   ` George Shuklin
  1 sibling, 1 reply; 4+ messages in thread
From: Valdis.Kletnieks @ 2011-09-02 19:53 UTC (permalink / raw)
  To: George Shuklin; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 460 bytes --]

On Fri, 02 Sep 2011 19:41:29 +0400, George Shuklin said:
> Good day.
> 
> Why si_swapinfo (from include/linux/swap.h) is not marked as
> EXPORT_SYMBOL_GPL? It's kinda hard to gain information about memory in
> module. 

Use case?  What information exactly are you trying to get in the module, and
equally important, why?  More likely, what you *actually* want isn't the
information, it's a new API (or using an existing one you didn't even know was
there) :)


[-- Attachment #2: Type: application/pgp-signature, Size: 227 bytes --]

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

* Re: si_swapinfo export
  2011-09-02 19:53 ` Valdis.Kletnieks
@ 2011-09-03  0:52   ` George Shuklin
  0 siblings, 0 replies; 4+ messages in thread
From: George Shuklin @ 2011-09-03  0:52 UTC (permalink / raw)
  To: Valdis.Kletnieks; +Cc: linux-kernel

Well, in my personal case it is some 'memory pressure service' for 
virtual machines in xen environment.

It check about 1-2 times per second memory state and report it to 
management software outside VM. Right now this is userspace program, 
which reads /proc/meminfo and sends it via xenstore (interdomain 
communication system) to management domain. It works fine, but we need 
to do double int-str conversion (/proc/meminfo do itoa, our daemon sens 
this to control domain, daemon in control domain do atoi and math to get 
right memory value). This is very inefficient, especially when we talks 
about bunch of VM per host.

kernel module can do math internally with ints, not with strings (no 
conversion at all) - this will save pretty much time (my calculation is 
about one-two of CPU time per day for every virtualization host with 
about 50-100 active VMs.

The information I needs is amount of 'really free' memory. We calculate 
it as (roughly) as  MemFree+Buffers+Cached+(SwapTotal-SwapFree), and our 
management system trying to keep this value within expected values (f.e. 
within interval 128-256Mb). This allows us to prevent VM's swapping and 
allow VM to push to swap really rare used pages (and their place 
actually used for caching).


On 02.09.2011 23:53, Valdis.Kletnieks@vt.edu wrote:
> On Fri, 02 Sep 2011 19:41:29 +0400, George Shuklin said:
>> Good day.
>>
>> Why si_swapinfo (from include/linux/swap.h) is not marked as
>> EXPORT_SYMBOL_GPL? It's kinda hard to gain information about memory in
>> module.
> Use case?  What information exactly are you trying to get in the module, and
> equally important, why?  More likely, what you *actually* want isn't the
> information, it's a new API (or using an existing one you didn't even know was
> there) :)
>

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

end of thread, other threads:[~2011-09-03  0:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-02 15:41 si_swapinfo export George Shuklin
2011-09-02 16:18 ` Christoph Lameter
2011-09-02 19:53 ` Valdis.Kletnieks
2011-09-03  0:52   ` George Shuklin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.