CEPH filesystem development
 help / color / mirror / Atom feed
From: Xiubo Li <xiubli@redhat.com>
To: Jeff Layton <jlayton@kernel.org>
Cc: idryomov@gmail.com, ceph-devel@vger.kernel.org,
	Matthew Wilcox <willy@infradead.org>
Subject: Re: [PATCH] ceph: switch back to testing for NULL folio->private in ceph_dirty_folio
Date: Mon, 13 Jun 2022 08:48:40 +0800	[thread overview]
Message-ID: <6189bdb3-6bfa-b85a-8df5-0fe94d7a962a@redhat.com> (raw)
In-Reply-To: <20220610154013.68259-1-jlayton@kernel.org>


On 6/10/22 11:40 PM, Jeff Layton wrote:
> Willy requested that we change this back to warning on folio->private
> being non-NULl. He's trying to kill off the PG_private flag, and so we'd
> like to catch where it's non-NULL.
>
> Add a VM_WARN_ON_FOLIO (since it doesn't exist yet) and change over to
> using that instead of VM_BUG_ON_FOLIO along with testing the ->private
> pointer.
>
> Cc: Matthew Wilcox <willy@infradead.org>
> Signed-off-by: Jeff Layton <jlayton@kernel.org>
> ---
>   fs/ceph/addr.c          | 2 +-
>   include/linux/mmdebug.h | 9 +++++++++
>   2 files changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
> index b43cc01a61db..b24d6bdb91db 100644
> --- a/fs/ceph/addr.c
> +++ b/fs/ceph/addr.c
> @@ -122,7 +122,7 @@ static bool ceph_dirty_folio(struct address_space *mapping, struct folio *folio)
>   	 * Reference snap context in folio->private.  Also set
>   	 * PagePrivate so that we get invalidate_folio callback.
>   	 */
> -	VM_BUG_ON_FOLIO(folio_test_private(folio), folio);
> +	VM_WARN_ON_FOLIO(folio->private, folio);
>   	folio_attach_private(folio, snapc);
>   
>   	return ceph_fscache_dirty_folio(mapping, folio);
> diff --git a/include/linux/mmdebug.h b/include/linux/mmdebug.h
> index d7285f8148a3..5107bade2ab2 100644
> --- a/include/linux/mmdebug.h
> +++ b/include/linux/mmdebug.h
> @@ -54,6 +54,15 @@ void dump_mm(const struct mm_struct *mm);
>   	}								\
>   	unlikely(__ret_warn_once);					\
>   })
> +#define VM_WARN_ON_FOLIO(cond, folio)		({			\
> +	int __ret_warn = !!(cond);					\
> +									\
> +	if (unlikely(__ret_warn)) {					\
> +		dump_page(&folio->page, "VM_WARN_ON_FOLIO(" __stringify(cond)")");\
> +		WARN_ON(1);						\
> +	}								\
> +	unlikely(__ret_warn);						\
> +})

I have fixed the compile warning reported by kernel test robot by 
defining it in case the DEBUG_VM is disabled in testing branch.

-- Xiubo


>   #define VM_WARN_ON_ONCE_FOLIO(cond, folio)	({			\
>   	static bool __section(".data.once") __warned;			\
>   	int __ret_warn_once = !!(cond);					\


  parent reply	other threads:[~2022-06-13  0:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-10 15:40 [PATCH] ceph: switch back to testing for NULL folio->private in ceph_dirty_folio Jeff Layton
2022-06-12  9:49 ` Xiubo Li
2022-06-13  0:48 ` Xiubo Li [this message]
2022-06-19  3:49   ` Matthew Wilcox
2022-06-20  1:30     ` Xiubo Li

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=6189bdb3-6bfa-b85a-8df5-0fe94d7a962a@redhat.com \
    --to=xiubli@redhat.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=idryomov@gmail.com \
    --cc=jlayton@kernel.org \
    --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