From: Dmitry Osipenko <digetx@gmail.com>
To: Thierry Reding <thierry.reding@gmail.com>,
Joerg Roedel <joro@8bytes.org>,
Jonathan Hunter <jonathanh@nvidia.com>,
Krishna Reddy <vdumpa@nvidia.com>
Cc: iommu@lists.linux-foundation.org, linux-tegra@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4] iommu/tegra-smmu: Add locking around mapping operations
Date: Tue, 1 Sep 2020 21:56:21 +0300 [thread overview]
Message-ID: <2d38fcab-bc7a-2986-ff39-9403164914e4@gmail.com> (raw)
In-Reply-To: <20200901171305.6929-1-digetx@gmail.com>
01.09.2020 20:13, Dmitry Osipenko пишет:
...
> + /*
> + * In order to prevent exhaustion of the atomic memory pool, we
> + * allocate page in a sleeping context if GFP flags permit. Hence
> + * spinlock needs to be unlocked and re-locked after allocation.
> + */
> + if (!(gfp & GFP_NOWAIT))
> + spin_unlock_irqrestore(&as->lock, *flags);
> +
> + page = alloc_page(gfp | __GFP_DMA | __GFP_ZERO);
> +
> + if (!(gfp & GFP_NOWAIT))
> + spin_lock_irqsave(&as->lock, *flags);
I realized that GFP_NOWAIT is a wrong flag to check here once I saw
warnings about sleeping in atomic context. Apparently __GFP_ATOMIC
should be used instead, I'll make v5.
prev parent reply other threads:[~2020-09-01 18:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-01 17:13 [PATCH v4] iommu/tegra-smmu: Add locking around mapping operations Dmitry Osipenko
2020-09-01 18:56 ` Dmitry Osipenko [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=2d38fcab-bc7a-2986-ff39-9403164914e4@gmail.com \
--to=digetx@gmail.com \
--cc=iommu@lists.linux-foundation.org \
--cc=jonathanh@nvidia.com \
--cc=joro@8bytes.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=thierry.reding@gmail.com \
--cc=vdumpa@nvidia.com \
/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