All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leonid Podolny <leonid99@mail.ru>
To: lkml <linux-kernel@vger.kernel.org>
Subject: Bug in mm.h?
Date: Thu, 07 Apr 2005 12:11:13 +0300	[thread overview]
Message-ID: <4254F931.6010200@mail.ru> (raw)

I fail to understand whether the following is a bug. From what I see, if
the page is reserved, page->count is not decreased. The order of the
conditions should be reversed.

>From mm.h:

static inline void put_page(struct page *page)
{
        if (!PageReserved(page) && put_page_testzero(page))
                __page_cache_release(page);
}

static inline void get_page(struct page *page)
{
        atomic_inc(&page->_count);
}

#define put_page_testzero(p)                            \
        ({                                              \
                BUG_ON(page_count(p) == 0);             \
                atomic_add_negative(-1, &(p)->_count);  \
        })


                 reply	other threads:[~2005-04-07  9:11 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=4254F931.6010200@mail.ru \
    --to=leonid99@mail.ru \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.