All of lore.kernel.org
 help / color / mirror / Atom feed
From: "M. Koehrer" <mathias_koehrer@domain.hid>
To: rpm@xenomai.org, mathias_koehrer@domain.hid
Cc: xenomai@xenomai.org
Subject: Re: Re: Re: [Xenomai-help] Error: cat: /proc/xenomai/stat: Cannot
Date: Fri, 2 Feb 2007 15:13:31 +0100 (CET)	[thread overview]
Message-ID: <26362385.1170425611905.JavaMail.ngmail@domain.hid> (raw)
In-Reply-To: <22474211.1170411361268.JavaMail.ngmail@domain.hid>

Hi all,

I have now identified the issue and provided a workaround.
I am using a kernel module as a hardware driver.
The kernel module was originally designed for standard linux and I modified it only slightly to 
have Xenomai support.
For configuring the driver, a /dev/xxx character file is provided.

When this file is opened (which lead to the module's open that is registered via register_chrdev)
an interrupt routine is registered.
I do here a rt_intr_create() followed by a rt_intr_enable().
When the /dev/xxx file is closed, the module's release function is called.
This function calls rt_intr_disable() and rt_intr_delete() to stop using the interrupt.

This looks very fine, however it seems to cause problems.
Having this situation, I get the kernel "cannot allocate memory" message.

I did a restructuring of the kernel module to disable the interrupt routine and to
delete the interrupt object not with the release() function but within
cleanup_module(). And this works now perfect.

I do not understand the reason for this but now it is working.

Thanks for all the hints on that issue.

Regards


Mathias

----- Original Nachricht ----
Von:     "M. Koehrer" <mathias_koehrer@domain.hid>
An:      rpm@xenomai.org
Datum:   02.02.2007 11:16
Betreff: Re: Re: [Xenomai-help] Error: cat: /proc/xenomai/stat: Cannot
 allocate

> Hi!
> 
> I have one kernel module for a special driver running.
> If I do not load this kernel module, everything seems to work fine.
> That means, this kernel module is probably causing the issue...
> I have to look closer to it...
> Sorry for any confusion!
> 
> Regards
> 
> Mathias 
> 
> 
> > On Fri, 2007-02-02 at 10:33 +0100, Philippe Gerum wrote:
> > > On Fri, 2007-02-02 at 09:43 +0100, M. Koehrer wrote:
> > > > Hi everybody,
> > > > 
> > > > I have a strange issue frequently when reading /proc/xenomai/stat.
> > > > I do a cat /proc/xenomai/stat and I get an "Cannot allocate memory"
> > error.
> > > > This happens typcially after I have started and terminated by
> > application that uses a number of tasks.
> > > > I am able to reproduce it deterministically...
> > > > While the application is running, I can see the stat values
> perfectly.
> > > > Here is the head output of all /proc/xenomai/* files:
> > > 
> > > At first sight looking at the code, there seems to be a memory leak
> > > caused by an unfree kmalloc() block in the sched & stat sequence
> > > routines. Will confirm and fix. Thanks,
> > > 
> > 
> > Not confirmed for the leakage part regarding kmalloc(). We do have a
> > seq_release_private() freeing the allocated block, so back to square #1.
> > This said, some kernel memory is not released somewhere, as running
> > vmstat tells me here.
> > 
> > Btw, is the rest of your system functional after the error occurs, or is
> > a reboot needed afterwise?
> > 
> > -- 
> > Philippe.
> > 
> > 
> > 
> 
> -- 
> Mathias Koehrer
> mathias_koehrer@domain.hid
> 
> 
> Viel oder wenig? Schnell oder langsam? Unbegrenzt surfen + telefonieren
> ohne Zeit- und Volumenbegrenzung? DAS TOP ANGEBOT JETZT bei Arcor: günstig
> und schnell mit DSL - das All-Inclusive-Paket für clevere Doppel-Sparer,
> nur  44,85 €  inkl. DSL- und ISDN-Grundgebühr!
> http://www.arcor.de/rd/emf-dsl-2
> 

-- 
Mathias Koehrer
mathias_koehrer@domain.hid


Viel oder wenig? Schnell oder langsam? Unbegrenzt surfen + telefonieren
ohne Zeit- und Volumenbegrenzung? DAS TOP ANGEBOT JETZT bei Arcor: günstig
und schnell mit DSL - das All-Inclusive-Paket für clevere Doppel-Sparer,
nur  44,85 €  inkl. DSL- und ISDN-Grundgebühr!
http://www.arcor.de/rd/emf-dsl-2


      reply	other threads:[~2007-02-02 14:13 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-02  8:43 [Xenomai-help] Error: cat: /proc/xenomai/stat: Cannot allocate memory M. Koehrer
2007-02-02  9:33 ` Philippe Gerum
2007-02-02  9:49   ` Philippe Gerum
2007-02-02  9:51     ` Gilles Chanteperdrix
2007-02-02 11:23       ` Philippe Gerum
2007-02-02 12:44         ` Philippe Gerum
2007-02-02 12:58           ` Re: [Xenomai-help] Error: cat: /proc/xenomai/stat: Cannot allocate M. Koehrer
2007-02-02 14:35             ` Philippe Gerum
2007-02-02 12:59           ` [Xenomai-help] Error: cat: /proc/xenomai/stat: Cannot allocate memory Rus V. Brushkoff
2007-02-02 14:31             ` Philippe Gerum
2007-02-02 14:36               ` Rus V. Brushkoff
2007-02-03 16:08                 ` Rus V. Brushkoff
2007-02-03 16:38                   ` Philippe Gerum
2007-02-03 18:20                     ` Dmitry Adamushko
2007-02-03 19:06                       ` Philippe Gerum
2007-02-04 13:54                         ` Dmitry Adamushko
2007-02-04 14:01                           ` Dmitry Adamushko
2007-02-05 10:02                             ` Rus V. Brushkoff
2007-02-05 16:05                             ` Paul
2007-02-04  7:16                     ` Rus V. Brushkoff
2007-02-04  9:12                       ` Philippe Gerum
2007-02-03 23:20                   ` Paul
2007-02-02 14:42               ` Jan Kiszka
2007-02-02 14:55                 ` Paul
2007-02-02 15:07                   ` Rus V. Brushkoff
2007-02-02 15:16                     ` Philippe Gerum
2007-02-02 15:29                       ` Philippe Gerum
2007-02-02 10:16     ` Re: [Xenomai-help] Error: cat: /proc/xenomai/stat: Cannot allocate M. Koehrer
2007-02-02 14:13       ` M. Koehrer [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=26362385.1170425611905.JavaMail.ngmail@domain.hid \
    --to=mathias_koehrer@domain.hid \
    --cc=rpm@xenomai.org \
    --cc=xenomai@xenomai.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 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.