mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "yogeshwar sonawane" <yogyas@gmail.com>
To: davids@webmaster.com
Cc: linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: Excessive printks increase top mem usage?
Date: Sun, 4 Feb 2007 16:40:09 +0530	[thread overview]
Message-ID: <b681c62b0702040310g766048ci1af89174c4cb9d07@mail.gmail.com> (raw)
In-Reply-To: <b681c62b0702030411x2a61f453t4e2997ce866417e6@mail.gmail.com>

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/
> >
>

      parent reply	other threads:[~2007-02-04 11:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-25 13:23 yogeshwar sonawane
2007-01-26  1:03 ` David Schwartz
     [not found]   ` <b681c62b0702030411x2a61f453t4e2997ce866417e6@mail.gmail.com>
2007-02-04 11:10     ` yogeshwar sonawane [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b681c62b0702040310g766048ci1af89174c4cb9d07@mail.gmail.com \
    --to=yogyas@gmail.com \
    --cc=davids@webmaster.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®