mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Gwénaël Cotrez" <gcotrez@jetmultimedia.net>
To: linux-kernel@vger.kernel.org
Subject: Question about /proc/partitions
Date: Sun,  2 Nov 2003 17:23:39 +0100	[thread overview]
Message-ID: <1067790219.3fa52f8bc8af5@imp2-a.free.fr> (raw)

Hi,
I'm developing a system accounting, which get informations about I/O in
/proc/partitions.
But, I've noticed that sometimes this system returns informations about negative
I/O.
I find this in in the kernel tree source :
http://lxr.linux.no/source/include/linux/genhd.h?v=2.4.22#L61

61 struct hd_struct {
...........
69         /* Performance stats: */
70         unsigned int ios_in_flight;
71         unsigned int io_ticks;
72         unsigned int last_idle_time;
73         unsigned int last_queue_change;
74         unsigned int aveq;
75        
76         unsigned int rd_ios;
77         unsigned int rd_merges;
78         unsigned int rd_ticks;
79         unsigned int rd_sectors;
80         unsigned int wr_ios;
81         unsigned int wr_merges;
82         unsigned int wr_ticks;
83         unsigned int wr_sectors;       
84 #endif /* CONFIG_BLK_STATS */
85 };

but in http://lxr.linux.no/source/drivers/block/genhd.c?v=2.4.22#L181

static int part_show(struct seq_file *s, void *v)
.............
189 #ifdef CONFIG_BLK_STATS
190                             "     rio rmerge rsect ruse wio wmerge "
191                             "wsect wuse running use aveq"
......
203                         seq_printf(s, "%4d  %4d %10d %s "                  
                <------
204                                       "%d %d %d %d %d %d %d %d %d %d %d\n",
     <------
205                                       gp->major, n, gp->sizes[n],
206                                       disk_name(gp, n, buf),
207                                       hd->rd_ios, hd->rd_merges,
208 #define MSEC(x) ((x) * 1000 / HZ)
209                                       hd->rd_sectors, MSEC(hd->rd_ticks),
210                                       hd->wr_ios, hd->wr_merges,
211                                       hd->wr_sectors, MSEC(hd->wr_ticks),
212                                       hd->ios_in_flight, MSEC(hd->io_ticks),
213                                       MSEC(hd->aveq));
.....................
223 }

I think that negative I/O result of the usage of %d in seq_printf function for
variable declared as  unsigned int.
Somebody could confirm me this

Thank's


                 reply	other threads:[~2003-11-02 16:23 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1067790219.3fa52f8bc8af5@imp2-a.free.fr \
    --to=gcotrez@jetmultimedia.net \
    --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®