From: John David Anglin <dave.anglin@bell.net>
To: Rolf Eike Beer <eike-kernel@sf-tec.de>, linux-parisc@vger.kernel.org
Subject: Re: pagefaults and hang with 5.15.11
Date: Tue, 25 Jan 2022 12:26:15 -0500 [thread overview]
Message-ID: <e045d706-62cb-d3ff-53a9-727192068d5d@bell.net> (raw)
In-Reply-To: <4711347.31r3eYUQgx@eto.sf-tec.de>
On 2022-01-25 11:54 a.m., Rolf Eike Beer wrote:
> Am Montag, 24. Januar 2022, 18:41:27 CET schrieb John David Anglin:
>> On 2022-01-24 12:24 p.m., John David Anglin wrote:
>>> Faulting instruction is "ldw 18(r3),r24". Address in $r3 (and $r5) seems
>>> bad. Think the sglist argument
>>> to sba_unmap_sg() is bad. Don't have a clue as to why this might be.
>> Maybe try interchanging operands of following &&
>>
>> while (sg_dma_len(sglist) && nents--) {
>>
>> so nents is checked first.
> But nents would be increased then even for the case that sg_dma_len() returns
> false, which may or may not be wanted.
You are correct. The decrement of nents needs to be in loop so count in following DBG_RUN_SG is correct:
while (sg_dma_len(sglist) && nents--) {
sba_unmap_page(dev, sg_dma_address(sglist), sg_dma_len(sglist),
direction, 0);
#ifdef SBA_COLLECT_STATS
ioc->usg_pages += ((sg_dma_address(sglist) & ~IOVP_MASK) + sg_dma_len(sglist) + IOVP_SIZE - 1) >> PAGE_SHIFT;
ioc->usingle_calls--; /* kluge since call is unmap_sg() */
#endif
++sglist;
}
DBG_RUN_SG("%s() DONE (nents %d)\n", __func__, nents);
However, nents still needs to be checked first.
What has happened is the sglist pointer has crossed a page boundary causing the TLB miss. The offset of sg_dma_len is 0x18
and checking sg_dma_len(sglist) first causes the fault.
--
John David Anglin dave.anglin@bell.net
prev parent reply other threads:[~2022-01-25 17:29 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-26 16:21 pagefaults and hang with 5.15.11 Rolf Eike Beer
2021-12-26 17:22 ` John David Anglin
2021-12-27 14:30 ` Rolf Eike Beer
2021-12-28 21:55 ` Rolf Eike Beer
2022-01-01 22:12 ` Sven Schnelle
2022-01-01 22:28 ` Rolf Eike Beer
2022-01-02 10:24 ` Sven Schnelle
2022-01-02 22:42 ` John David Anglin
2022-01-02 22:53 ` Helge Deller
2022-01-02 23:14 ` John David Anglin
2022-01-05 7:42 ` Rolf Eike Beer
2022-01-05 12:08 ` Helge Deller
2022-01-06 0:40 ` Rolf Eike Beer
2022-01-23 11:53 ` Rolf Eike Beer
2022-01-23 13:51 ` John David Anglin
2022-01-23 14:36 ` Helge Deller
2022-01-24 6:41 ` Rolf Eike Beer
2022-01-24 17:24 ` John David Anglin
2022-01-24 17:41 ` John David Anglin
2022-01-25 16:54 ` Rolf Eike Beer
2022-01-25 17:26 ` John David Anglin [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=e045d706-62cb-d3ff-53a9-727192068d5d@bell.net \
--to=dave.anglin@bell.net \
--cc=eike-kernel@sf-tec.de \
--cc=linux-parisc@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