From: Vineet Gupta <Vineet.Gupta1@synopsys.com>
To: Alexey Brodkin <Alexey.Brodkin@synopsys.com>,
"linux-snps-arc@lists.infradead.org"
<linux-snps-arc@lists.infradead.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"stable@vger.kernel.org" <stable@vger.kernel.org>
Subject: Re: [PATCH] ARC: Fix __swp_offset() implementation
Date: Thu, 28 Jun 2018 17:37:56 -0700 [thread overview]
Message-ID: <1406e091-d288-c5d6-5340-1bbca25d39c2@synopsys.com> (raw)
In-Reply-To: <20180628235914.20706-1-abrodkin@synopsys.com>
On 06/28/2018 04:59 PM, Alexey Brodkin wrote:
> We encode offset from swapcache page in __swp_entry() this way, see [1]:
> | /* Encode swap {type,off} tuple into PTE
> | * We reserve 13 bits for 5-bit @type, keeping bits 12-5 zero, ensuring that
> | * PAGE_PRESENT is zero in a PTE holding swap "identifier"
> | */
> | #define __swp_entry(type, off) ((swp_entry_t) { \
> | ((type) & 0x1f) | ((off) << 13) })
>
> But decode in __swp_offset() as:
> | #define __swp_offset(pte_lookalike) ((pte_lookalike).val << 13)
> which is obviously wrong, we should ">> 13" instead.
>
> This basically fixes swap usage on ARC finally.
Nice. Wish all fixes were so simple ;-)
I've added this to for-curr and will also make its way to stable, but lets clean
up this mess of hardcoded 13 properly as a cleanup patch. There are good
references to look at : arm, riscv etc
Thx,
-Vineet
prev parent reply other threads:[~2018-06-29 0:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-28 23:59 Alexey Brodkin
2018-06-29 0:37 ` Vineet Gupta [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=1406e091-d288-c5d6-5340-1bbca25d39c2@synopsys.com \
--to=vineet.gupta1@synopsys.com \
--cc=Alexey.Brodkin@synopsys.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-snps-arc@lists.infradead.org \
--cc=stable@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®