linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: PINTU KUMAR <pintu_agarwal@yahoo.com>
To: Hugh Dickins <hughd@google.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>
Subject: Re: [Help] : RSS/PSS showing 0 during smaps for Xorg
Date: Wed, 1 Feb 2012 06:49:18 -0800 (PST)	[thread overview]
Message-ID: <1328107758.5077.YahooMailNeo@web162002.mail.bf1.yahoo.com> (raw)
In-Reply-To: <alpine.LSU.2.00.1201301034100.1884@eggly.anvils>

Dear Hugh,
 
Thank you for your help/suggestion so far.
 
Please find further updates on this below.
 
>Sounds like you're not using vm_insert_page() properly: I would not expect
>you to get a page fault there once you've set up the area with a loop of
>vm_insert_page()s.
>perhaps you're mapping less than you need to.

1)  The page fault is not occuring now after calling vm_insert_page() in a loop for every page. The hint about "mapping less than you need to" stricked me. Please check the snapshot below.
     loop
        vm_insert_page(vma,start,page);
        start = start + PAGE_SIZE;
        size = size - PAGE_SIZE;
    until size > 0
 
    I verified other drivers in kernel code and found this is how it is done.
 
2)  But after doing all this also my menu-screen is not proper. Still I am getting colorful lines on the menu-screen.
     Can you point me out what could be the problem??
 
 
 
Thanks, Regards,
Pintu
 
 
>________________________________
>From: Hugh Dickins <hughd@google.com>
>To: PINTU KUMAR <pintu_agarwal@yahoo.com> 
>Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>; "linux-mm@kvack.org" <linux-mm@kvack.org> 
>Sent: Tuesday, 31 January 2012 12:19 AM
>Subject: Re: [Help] : RSS/PSS showing 0 during smaps for Xorg
>
>On Mon, 30 Jan 2012, PINTU KUMAR wrote:
>>  
>> >If these are ordinary pages with struct pages, then you could probably
>> >use a loop of vm_insert_page()s to insert them at mmap time, or a fault
>> >routine to insert them on fault.  But as I said, I don't know if this
>> >memory is part of the ordinary page pool or not.
>>  
>> You suggestion about using vm_insert_page() instead of remap_pfn_range worked for me and I got the Rss/Pss information for my driver.
>
>Oh, I'm glad that happened to work for you.
>
>> But still there is one problem related to page fault. 
>> If I remove remap_pfn_range then I get a page fault in the beginning. 
>> I tried to use the same vm_insert_page() during page_fault_handler for each vmf->virtual_address but it did not work.
>> So for time being I remove the page fault handler from my vm_operations.
>> But with these my menu screen(LCD screen) is not behaving properly (I get colorful lines on my LCD).
>> So I need to handle the page fault properly.
>>  
>> But I am not sure what is that I need to do inside page fault handler. Do you have any example or references or suggestions?
>
>Sounds like you're not using vm_insert_page() properly: I would not expect
>you to get a page fault there once you've set up the area with a loop of
>vm_insert_page()s.
>
>Check the comments above it in mm/memory.c ("Your vma protection will
>have to be set up correctly" might be relevant).
>
>Compare how you're using it with other users of vm_insert_page() in
>the kernel tree.  Sorry, I don't have time to do your debugging.
>
>>  
>> >Really, the question has to be, why do you need to see non-0s there?
>> I want Rss/Pss value to account for how much video memory is used by the driver for the menu-screen,Xorg processes.
>
>So, userspace does an mmap for a large-enough window, but only some part of
>that is filled by the driver (whether by remap_pfn_range or vm_insert_pages),
>and you'd like to communicate back how much via the Rss, instead of adding
>some ioctl or sysfs interface to the driver?  Fair enough.
>
>I expect userspace could also work it out by touching pages of the area
>until it gets a SIGBUS, but that might be too dirty a way of finding out.
>
>Hmm, SIGBUS: maybe that's related to the faults that are puzzling you:
>perhaps you're mapping less than you need to.
>
>Hugh
>
>

  reply	other threads:[~2012-02-01 14:55 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1327310360.96918.YahooMailNeo@web162003.mail.bf1.yahoo.com>
2012-01-23 10:15 ` [Help] : RSS/PSS showing 0 during smaps for Xorg PINTU KUMAR
2012-01-23 19:31   ` Hugh Dickins
2012-01-25  5:22     ` PINTU KUMAR
2012-01-26  0:59       ` Hugh Dickins
2012-01-30  8:42         ` PINTU KUMAR
2012-01-30 18:49           ` Hugh Dickins
2012-02-01 14:49             ` PINTU KUMAR [this message]
2012-02-02  5:20               ` Hugh Dickins

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=1328107758.5077.YahooMailNeo@web162002.mail.bf1.yahoo.com \
    --to=pintu_agarwal@yahoo.com \
    --cc=hughd@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.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;
as well as URLs for NNTP newsgroup(s).