public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Lorinczy Zsigmond <lzsiga@mail.ahiv.hu>
To: linux-kernel@vger.kernel.org
Subject: Size of file /proc/mtrr
Date: Wed, 03 Oct 2001 11:50:12 +0200	[thread overview]
Message-ID: <3BBADF54.C36DAFAB@mail.ahiv.hu> (raw)

Hy Folks!

I found a little problem about file /proc/mtrr: it shorter than it is...

zsiga-pc:/usr/src/linux# ls -l /proc/mtrr
-rw-r--r--    1 root     root          132 Oct  3 10:03 /proc/mtrr
                                       ^^^ 

zsiga-pc:/usr/src/linux# cat /proc/mtrr | wc -c
    203
    ^^^
 
zsiga-pc:/usr/src/linux# cat /proc/mtrr
reg00: base=0x00000000 (   0MB), size= 128MB: write-back, count=1
reg01: base=0x08000000 ( 128MB), size=  32MB: write-back, count=1
reg02: base=0xf5000000 (3920MB), size=   4MB: write-combining, count=1
 
zsiga-pc:/usr/src/linux# mc -v /proc/mtrr
File: /proc/mtrr  132 bytes  100%
reg00: base=0x00000000 (   0MB), size= 128MB: write-back, count=1
reg01: base=0x08000000 ( 128MB), size=  32MB: write-back, count=1

I looked into arch/i386/kernel/mtrr.c, I found variable ascii_buf_bytes,
wich contains the real length (203 in this case), and is copied into
'proc_root_mtrr->size' (line 1863) when changes.

The problem is that the procfs do not follow the changing of this value
(caching problem ?), so stat(2) reports the old length (132).

Here is a quick workaround: set proc_root_mtrr->size to zero

--- mtrr.bak    Fri Sep 21 19:55:22 2001
+++ mtrr.c      Wed Oct  3 10:07:45 2001
@@ -1860,7 +1860,7 @@
     devfs_set_file_size (devfs_handle, ascii_buf_bytes);
 #  ifdef CONFIG_PROC_FS
     if (proc_root_mtrr)
-       proc_root_mtrr->size = ascii_buf_bytes;
+       proc_root_mtrr->size = 0;
 #  endif  /*  CONFIG_PROC_FS  */
 }   /*  End Function compute_ascii  */

                 reply	other threads:[~2001-10-03  8:45 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=3BBADF54.C36DAFAB@mail.ahiv.hu \
    --to=lzsiga@mail.ahiv.hu \
    --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