LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* Re: Excessive printks increase top mem usage?
@ 2007-01-25 13:23 yogeshwar sonawane
  2007-01-26  1:03 ` David Schwartz
  0 siblings, 1 reply; 3+ messages in thread
From: yogeshwar sonawane @ 2007-01-25 13:23 UTC (permalink / raw)
  To: linux-kernel

Subject is updated

On 1/25/07, yogeshwar sonawane <yogyas@gmail.com> wrote:
> Hi all,
> I am running a user application which will just open/close my driver
> (simple one, empty functions with only printks) infinitely.
> A massive use of printk can slow down the system noticeably OR it can
> affect some time calculations.
> Apart from this, it was increasing top mem usage also. After closing
> the application, the memory consumption was not coming down(not
> freeing mem). Is this the expected behaviour? OR i am missing
> something?
>
> Can anybody help me in guiding the reason for this? Any help/links plz.
>
> Thanks in advance,
> Yogeshwar
>

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

* RE: Excessive printks increase top mem usage?
  2007-01-25 13:23 Excessive printks increase top mem usage? yogeshwar sonawane
@ 2007-01-26  1:03 ` David Schwartz
       [not found]   ` <b681c62b0702030411x2a61f453t4e2997ce866417e6@mail.gmail.com>
  0 siblings, 1 reply; 3+ messages in thread
From: David Schwartz @ 2007-01-26  1:03 UTC (permalink / raw)
  To: linux-kernel


> On 1/25/07, yogeshwar sonawane <yogyas@gmail.com> wrote:
> > Hi all,
> > I am running a user application which will just open/close my driver
> > (simple one, empty functions with only printks) infinitely.
> > A massive use of printk can slow down the system noticeably OR it can
> > affect some time calculations.
> > Apart from this, it was increasing top mem usage also. After closing
> > the application, the memory consumption was not coming down(not
> > freeing mem). Is this the expected behaviour? OR i am missing
> > something?
> >
> > Can anybody help me in guiding the reason for this? Any help/links plz.
> >
> > Thanks in advance,
> > Yogeshwar

What does "increased top mem usage" mean? You have given no reason to
suggest that there's anything unusual about this.

Here's one theory: Some program is writing these kernel messages to a file.
Because some other process might come and read that file later, the kernel
keeps copies of the file data in memory.

The kernel sees no advantage in having memory free. Free memory is memory
that's not doing any good. Better to keep data in memory that might be
useful later. We can always free the memory later if (and only if) we have
something better to do with it.

DS



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

* Re: Excessive printks increase top mem usage?
       [not found]   ` <b681c62b0702030411x2a61f453t4e2997ce866417e6@mail.gmail.com>
@ 2007-02-04 11:10     ` yogeshwar sonawane
  0 siblings, 0 replies; 3+ messages in thread
From: yogeshwar sonawane @ 2007-02-04 11:10 UTC (permalink / raw)
  To: davids; +Cc: linux-kernel

cc to lkml

On 2/3/07, yogeshwar sonawane <yogyas@gmail.com> wrote:
> Thanks for the explanation.
>
> On 1/26/07, David Schwartz <davids@webmaster.com> wrote:
> >
> > > On 1/25/07, yogeshwar sonawane <yogyas@gmail.com> wrote:
> > > > Hi all,
> > > > I am running a user application which will just open/close my driver
> > > > (simple one, empty functions with only printks) infinitely.
> > > > A massive use of printk can slow down the system noticeably OR it can
> > > > affect some time calculations.
> > > > Apart from this, it was increasing top mem usage also. After closing
> > > > the application, the memory consumption was not coming down(not
> > > > freeing mem). Is this the expected behaviour? OR i am missing
> > > > something?
> > > >
> > > > Can anybody help me in guiding the reason for this? Any help/links plz.
> > > >
> > > > Thanks in advance,
> > > > Yogeshwar
> >
> > What does "increased top mem usage" mean? You have given no reason to
> > suggest that there's anything unusual about this.
> >
> > Here's one theory: Some program is writing these kernel messages to a file.
> > Because some other process might come and read that file later, the kernel
> > keeps copies of the file data in memory.
> >
> > The kernel sees no advantage in having memory free. Free memory is memory
> > that's not doing any good. Better to keep data in memory that might be
> > useful later. We can always free the memory later if (and only if) we have
> > something better to do with it.
>
> One more thing:-
> If i want to allocate physical memory using __get_free_pages, and
> there is no free mem available, then kernel will release mem used by
> file data & use it for my request. Is this correct?
> I just tried similar thing. My test machine has 4GB RAM. On my test
> machine, as explained in my previous mail, i was printing excessive
> messages. Due to this top was showing mem usage aroung 1.9GB. Then i
> tried allocation of 4MB phy mem(using __get_free_pages) iteratively
> till it fails. The allocation succeeded upto @ 4-1.9 GB. I thought
> that some mem from 1.9 GB will be released for phy mem allocation. But
> it didn't. Such runs were tried 3-4 times. But consistently it
> succeeded upto 4-1.9GB. So is this normal ?
>
> regards,
> Yogeshwar
>
> >
> > DS
> >
> >
> > -
> > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> > Please read the FAQ at  http://www.tux.org/lkml/
> >
>

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

end of thread, other threads:[~2007-02-04 11:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-25 13:23 Excessive printks increase top mem usage? yogeshwar sonawane
2007-01-26  1:03 ` David Schwartz
     [not found]   ` <b681c62b0702030411x2a61f453t4e2997ce866417e6@mail.gmail.com>
2007-02-04 11:10     ` yogeshwar sonawane

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).