linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gao Xiang <gaoxiang25@huawei.com>
To: Matthew Wilcox <willy@infradead.org>, Peter Geis <pgwipeout@gmail.com>
Cc: <linux-fsdevel@vger.kernel.org>,
	Johannes Weiner <hannes@cmpxchg.org>, <linux-mm@kvack.org>
Subject: Re: [BUG] Swap xarray workingset eviction warning.
Date: Mon, 2 Jul 2018 11:11:53 +0800	[thread overview]
Message-ID: <cb59ba75-61eb-4559-0865-202f6c78d3d0@huawei.com> (raw)
In-Reply-To: <20180702025059.GA9865@bombadil.infradead.org>

Hi Matthew,

On 2018/7/2 10:50, Matthew Wilcox wrote:
> On Sun, Jul 01, 2018 at 07:09:41PM -0400, Peter Geis wrote:
>> The warning is as follows:
>> [10409.408904] ------------[ cut here ]------------
>> [10409.408912] WARNING: CPU: 0 PID: 38 at ./include/linux/xarray.h:53
>> workingset_eviction+0x14c/0x154
> This is interesting.  Here's the code that leads to the warning:
> 
> static void *pack_shadow(int memcgid, pg_data_t *pgdat, unsigned long eviction)
> {
>         eviction >>= bucket_order;
>         eviction = (eviction << MEM_CGROUP_ID_SHIFT) | memcgid;
>         eviction = (eviction << NODES_SHIFT) | pgdat->node_id;
> 
>         return xa_mk_value(eviction);
> }
> 
> The warning itself comes from:
> 
> static inline void *xa_mk_value(unsigned long v)
> {
>         WARN_ON((long)v < 0);
>         return (void *)((v << 1) | 1);
> }

Sorry for breaking in, how do you think about considering

[RFC PATCH v4] <linux/tagptr.h>: Introduce tagged pointer
https://marc.info/?l=linux-kernel&m=153035209012070&w=2

to replace these masks? It seems boths for the XArray or old radix trees has many hacked code...

or if you think this implmentation is not ok, could you please give some suggestions or alternatives on tagptr...

> 
> The fact that we haven't seen this on other architectures makes me wonder
> if NODES_SHIFT or MEM_CGROUP_ID_SHIFT are messed up on Tegra?
> 
> Johannes, I wonder if you could help out here?  I'm not terribly familiar
> with this part of the workingset code.
Thanks,
Gao Xiang

  reply	other threads:[~2018-07-02  3:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-01 23:09 [BUG] Swap xarray workingset eviction warning Peter Geis
2018-07-02  2:50 ` Matthew Wilcox
2018-07-02  3:11   ` Gao Xiang [this message]
2018-07-05 17:00   ` Johannes Weiner
2018-07-05 17:53     ` Matthew Wilcox
2018-07-05 18:43       ` Johannes Weiner

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=cb59ba75-61eb-4559-0865-202f6c78d3d0@huawei.com \
    --to=gaoxiang25@huawei.com \
    --cc=hannes@cmpxchg.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=pgwipeout@gmail.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;
as well as URLs for NNTP newsgroup(s).