linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Deepak R Varma <drv@mailo.com>
To: Sidhartha Kumar <sidhartha.kumar@oracle.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	willy@infradead.org, Saurabh Singh Sengar <ssengar@microsoft.com>,
	Praveen Kumar <kumarpraveen@linux.microsoft.com>
Subject: Re: Query on mm/folio-compat: pagecache_get_page
Date: Wed, 15 Feb 2023 00:47:00 +0530	[thread overview]
Message-ID: <Y+veLBmkWIfOpWzL@ubun2204.myguest.virtualbox.org> (raw)
In-Reply-To: <ce84bac6-b868-76f9-4678-d3eeed42eae3@oracle.com>

On Tue, Feb 14, 2023 at 10:35:33AM -0800, Sidhartha Kumar wrote:
> On 2/14/23 10:23 AM, Deepak R Varma wrote:
> > Hello,
> > Could someone comment if it is safe to access the page member variable as
> > written on line #100 when folio is NULL as returned from the
> 
> It is safe to access the page member variable when folio is NULL because the
> offset of page within struct folio is 0.[1]

Wow. This is so well thought. Thank you Sidhartha.

./drv

> 
> 
> [1] https://lore.kernel.org/lkml/Y7h4jsv6jl0XSIsk@casper.infradead.org/T/
> 
> Thanks,
> Sidhartha Kumar
> 
> > __filemap_get_folio() function call? Is this kind of intentional page-fault
> > trigger for the system to handle a new/fresh page allocation?
> > 
> > 	  2         folio = __filemap_get_folio(mapping, index, fgp_flags, gfp);
> > 	  1         if (!folio || xa_is_value(folio))
> > 	100                 return &folio->page;
> > 	  1         return folio_file_page(folio, index);
> > 
> > The code is part of commit ID c5255b421fd04
> > 
> > Thank you,
> > ./drv
> > 
> > 
> > 
> 




      reply	other threads:[~2023-02-14 19:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-14 18:23 Deepak R Varma
2023-02-14 18:35 ` Sidhartha Kumar
2023-02-14 19:17   ` Deepak R Varma [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=Y+veLBmkWIfOpWzL@ubun2204.myguest.virtualbox.org \
    --to=drv@mailo.com \
    --cc=akpm@linux-foundation.org \
    --cc=kumarpraveen@linux.microsoft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=sidhartha.kumar@oracle.com \
    --cc=ssengar@microsoft.com \
    --cc=willy@infradead.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