linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Juan J. Quintela" <quintela@fi.udc.es>
To: Trond Myklebust <trond.myklebust@fys.uio.no>
Cc: linux-mm@kvack.org, Linus Torvalds <torvalds@transmeta.com>,
	linux-kernel@vger.rutgers.edu
Subject: Re: PATCH: rewrite of invalidate_inode_pages
Date: 12 May 2000 00:43:42 +0200	[thread overview]
Message-ID: <ytthfc4hfmp.fsf@vexeta.dc.fi.udc.es> (raw)
In-Reply-To: Trond Myklebust's message of "12 May 2000 00:28:35 +0200"

>>>>> "trond" == Trond Myklebust <trond.myklebust@fys.uio.no> writes:

Hi Trond

trond> You seem to assume that invalidate_inode_pages() is supposed to
trond> invalidate *all* pages in the inode. This is NOT the case, and any
trond> rewrite is going to lead to hard lockups if you try to make it so.

Or I don't understand some obvious (the big probability) or the old
code also try to invalidate *all* the pages in the inode.  If there
are some locked page we do a goto repeat, we do 

       head = &inode->i_mapping->pages;
and 
       curr = head->next; 

and then the test is:
    while(head != curr)

I can't see any difference with doing:

    head = &inode->i_mapping->pages;
    while (head != head->next)

(I have removed the locking to clarify the example).
It can be that I am not understanding something obvious, but I think
that the old code also invalidates oll the pages.

trond> Most calls to invalidate_inode_pages() are made while we hold the page
trond> lock for some page that has just been updated (and hence we know is up
trond> to date). The reason is that under NFS, we receive a set of attributes
trond> as part of the result from READ/WRITE/... If this triggers a cache
trond> invalidation, then we do not want to invalidate the page that we know
trond> is safe, hence we call invalidate_inode_pages() before the newly read
trond> in page is unlocked.

I think that the old code will not finish until we liberate all the
pages, the only way to go out the code is the continue or the end of
the loop, that does a goto before the loop.  I think that the only
real difference between the two codes (locking issues aside) is that
the old version does busy waiting, and new one, liberates all the
non_locked pages and then sleeps waiting one page to become unlocked.
the other version when find one page locked will continue until it
liberates one non locked page, and then will "repeat" the process from
the begining.  If my reasoning is wrong, please point me where, I can
see where.

Thanks a lot for your comments and your good work.

Later, Juan.

-- 
In theory, practice and theory are the same, but in practice they 
are different -- Larry McVoy
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux.eu.org/Linux-MM/

  reply	other threads:[~2000-05-11 22:43 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-05-11 21:40 Juan J. Quintela
2000-05-11 21:47 ` Linus Torvalds
2000-05-11 21:56   ` Juan J. Quintela
2000-05-11 22:22     ` Linus Torvalds
2000-05-12  1:01       ` Juan J. Quintela
2000-05-12  2:02         ` PATCH: new page_cache_get() (try 2) Juan J. Quintela
2000-05-11 22:22     ` PATCH: rewrite of invalidate_inode_pages Ingo Molnar
2000-05-11 22:34     ` Trond Myklebust
2000-05-11 22:54       ` Juan J. Quintela
2000-05-11 23:17         ` Trond Myklebust
2000-05-11 23:28           ` Juan J. Quintela
2000-05-11 23:55             ` Trond Myklebust
2000-05-12 11:28             ` John Cavan
2000-05-12 11:37               ` Juan J. Quintela
2000-05-12 12:51                 ` Trond Myklebust
2000-05-12 13:21                   ` Arjan van de Ven
2000-05-12 13:35                     ` Trond Myklebust
2000-05-12 17:57                       ` Juan J. Quintela
2000-05-12 13:30                   ` Juan J. Quintela
2000-05-11 22:05   ` Jeff V. Merkey
2000-05-11 22:28 ` Trond Myklebust
2000-05-11 22:43   ` Juan J. Quintela [this message]
2000-05-11 22:56     ` Trond Myklebust

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=ytthfc4hfmp.fsf@vexeta.dc.fi.udc.es \
    --to=quintela@fi.udc.es \
    --cc=linux-kernel@vger.rutgers.edu \
    --cc=linux-mm@kvack.org \
    --cc=torvalds@transmeta.com \
    --cc=trond.myklebust@fys.uio.no \
    /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