[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20201009195033.3208459-41-ira.weiny@intel.com>
Date: Fri, 9 Oct 2020 12:50:15 -0700
From: ira.weiny@...el.com
To: Andrew Morton <akpm@...ux-foundation.org>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
Andy Lutomirski <luto@...nel.org>,
Peter Zijlstra <peterz@...radead.org>
Cc: Ira Weiny <ira.weiny@...el.com>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Alexey Kuznetsov <kuznet@....inr.ac.ru>,
Hideaki YOSHIFUJI <yoshfuji@...ux-ipv6.org>,
Trond Myklebust <trond.myklebust@...merspace.com>,
Anna Schumaker <anna.schumaker@...app.com>,
Boris Pismenny <borisp@...dia.com>,
Aviad Yehezkel <aviadye@...dia.com>,
John Fastabend <john.fastabend@...il.com>,
Daniel Borkmann <daniel@...earbox.net>, x86@...nel.org,
Dave Hansen <dave.hansen@...ux.intel.com>,
Dan Williams <dan.j.williams@...el.com>,
Fenghua Yu <fenghua.yu@...el.com>, linux-doc@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-nvdimm@...ts.01.org,
linux-fsdevel@...r.kernel.org, linux-mm@...ck.org,
linux-kselftest@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org,
kvm@...r.kernel.org, netdev@...r.kernel.org, bpf@...r.kernel.org,
kexec@...ts.infradead.org, linux-bcache@...r.kernel.org,
linux-mtd@...ts.infradead.org, devel@...verdev.osuosl.org,
linux-efi@...r.kernel.org, linux-mmc@...r.kernel.org,
linux-scsi@...r.kernel.org, target-devel@...r.kernel.org,
linux-nfs@...r.kernel.org, ceph-devel@...r.kernel.org,
linux-ext4@...r.kernel.org, linux-aio@...ck.org,
io-uring@...r.kernel.org, linux-erofs@...ts.ozlabs.org,
linux-um@...ts.infradead.org, linux-ntfs-dev@...ts.sourceforge.net,
reiserfs-devel@...r.kernel.org,
linux-f2fs-devel@...ts.sourceforge.net,
linux-nilfs@...r.kernel.org, cluster-devel@...hat.com,
ecryptfs@...r.kernel.org, linux-cifs@...r.kernel.org,
linux-btrfs@...r.kernel.org, linux-afs@...ts.infradead.org,
linux-rdma@...r.kernel.org, amd-gfx@...ts.freedesktop.org,
dri-devel@...ts.freedesktop.org, intel-gfx@...ts.freedesktop.org,
drbd-dev@...ts.linbit.com, linux-block@...r.kernel.org,
xen-devel@...ts.xenproject.org, linux-cachefs@...hat.com,
samba-technical@...ts.samba.org, intel-wired-lan@...ts.osuosl.org
Subject: [PATCH RFC PKS/PMEM 40/58] net: Utilize new kmap_thread()
From: Ira Weiny <ira.weiny@...el.com>
These kmap() calls in these drivers are localized to a single thread.
To avoid the over head of global PKRS updates use the new kmap_thread()
call.
Cc: "David S. Miller" <davem@...emloft.net>
Cc: Jakub Kicinski <kuba@...nel.org>
Cc: Alexey Kuznetsov <kuznet@....inr.ac.ru>
Cc: Hideaki YOSHIFUJI <yoshfuji@...ux-ipv6.org>
Cc: Trond Myklebust <trond.myklebust@...merspace.com>
Cc: Anna Schumaker <anna.schumaker@...app.com>
Cc: Boris Pismenny <borisp@...dia.com>
Cc: Aviad Yehezkel <aviadye@...dia.com>
Cc: John Fastabend <john.fastabend@...il.com>
Cc: Daniel Borkmann <daniel@...earbox.net>
Signed-off-by: Ira Weiny <ira.weiny@...el.com>
---
net/ceph/messenger.c | 4 ++--
net/core/datagram.c | 4 ++--
net/core/sock.c | 8 ++++----
net/ipv4/ip_output.c | 4 ++--
net/sunrpc/cache.c | 4 ++--
net/sunrpc/xdr.c | 8 ++++----
net/tls/tls_device.c | 4 ++--
7 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
index d4d7a0e52491..0c49b8e333da 100644
--- a/net/ceph/messenger.c
+++ b/net/ceph/messenger.c
@@ -1535,10 +1535,10 @@ static u32 ceph_crc32c_page(u32 crc, struct page *page,
{
char *kaddr;
- kaddr = kmap(page);
+ kaddr = kmap_thread(page);
BUG_ON(kaddr == NULL);
crc = crc32c(crc, kaddr + page_offset, length);
- kunmap(page);
+ kunmap_thread(page);
return crc;
}
diff --git a/net/core/datagram.c b/net/core/datagram.c
index 639745d4f3b9..cbd0a343074a 100644
--- a/net/core/datagram.c
+++ b/net/core/datagram.c
@@ -441,14 +441,14 @@ static int __skb_datagram_iter(const struct sk_buff *skb, int offset,
end = start + skb_frag_size(frag);
if ((copy = end - offset) > 0) {
struct page *page = skb_frag_page(frag);
- u8 *vaddr = kmap(page);
+ u8 *vaddr = kmap_thread(page);
if (copy > len)
copy = len;
n = INDIRECT_CALL_1(cb, simple_copy_to_iter,
vaddr + skb_frag_off(frag) + offset - start,
copy, data, to);
- kunmap(page);
+ kunmap_thread(page);
offset += n;
if (n != copy)
goto short_copy;
diff --git a/net/core/sock.c b/net/core/sock.c
index 6c5c6b18eff4..9b46a75cd8c1 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -2846,11 +2846,11 @@ ssize_t sock_no_sendpage(struct socket *sock, struct page *page, int offset, siz
ssize_t res;
struct msghdr msg = {.msg_flags = flags};
struct kvec iov;
- char *kaddr = kmap(page);
+ char *kaddr = kmap_thread(page);
iov.iov_base = kaddr + offset;
iov.iov_len = size;
res = kernel_sendmsg(sock, &msg, &iov, 1, size);
- kunmap(page);
+ kunmap_thread(page);
return res;
}
EXPORT_SYMBOL(sock_no_sendpage);
@@ -2861,12 +2861,12 @@ ssize_t sock_no_sendpage_locked(struct sock *sk, struct page *page,
ssize_t res;
struct msghdr msg = {.msg_flags = flags};
struct kvec iov;
- char *kaddr = kmap(page);
+ char *kaddr = kmap_thread(page);
iov.iov_base = kaddr + offset;
iov.iov_len = size;
res = kernel_sendmsg_locked(sk, &msg, &iov, 1, size);
- kunmap(page);
+ kunmap_thread(page);
return res;
}
EXPORT_SYMBOL(sock_no_sendpage_locked);
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index e6f2ada9e7d5..05304fb251a4 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -949,9 +949,9 @@ csum_page(struct page *page, int offset, int copy)
{
char *kaddr;
__wsum csum;
- kaddr = kmap(page);
+ kaddr = kmap_thread(page);
csum = csum_partial(kaddr + offset, copy, 0);
- kunmap(page);
+ kunmap_thread(page);
return csum;
}
diff --git a/net/sunrpc/cache.c b/net/sunrpc/cache.c
index baef5ee43dbb..88193f2a8e6f 100644
--- a/net/sunrpc/cache.c
+++ b/net/sunrpc/cache.c
@@ -935,9 +935,9 @@ static ssize_t cache_downcall(struct address_space *mapping,
if (!page)
goto out_slow;
- kaddr = kmap(page);
+ kaddr = kmap_thread(page);
ret = cache_do_downcall(kaddr, buf, count, cd);
- kunmap(page);
+ kunmap_thread(page);
unlock_page(page);
put_page(page);
return ret;
diff --git a/net/sunrpc/xdr.c b/net/sunrpc/xdr.c
index be11d672b5b9..00afbb48fb0a 100644
--- a/net/sunrpc/xdr.c
+++ b/net/sunrpc/xdr.c
@@ -1353,7 +1353,7 @@ xdr_xcode_array2(struct xdr_buf *buf, unsigned int base,
base &= ~PAGE_MASK;
avail_page = min_t(unsigned int, PAGE_SIZE - base,
avail_here);
- c = kmap(*ppages) + base;
+ c = kmap_thread(*ppages) + base;
while (avail_here) {
avail_here -= avail_page;
@@ -1429,9 +1429,9 @@ xdr_xcode_array2(struct xdr_buf *buf, unsigned int base,
}
}
if (avail_here) {
- kunmap(*ppages);
+ kunmap_thread(*ppages);
ppages++;
- c = kmap(*ppages);
+ c = kmap_thread(*ppages);
}
avail_page = min(avail_here,
@@ -1471,7 +1471,7 @@ xdr_xcode_array2(struct xdr_buf *buf, unsigned int base,
out:
kfree(elem);
if (ppages)
- kunmap(*ppages);
+ kunmap_thread(*ppages);
return err;
}
diff --git a/net/tls/tls_device.c b/net/tls/tls_device.c
index b74e2741f74f..ead5b1c485f8 100644
--- a/net/tls/tls_device.c
+++ b/net/tls/tls_device.c
@@ -576,13 +576,13 @@ int tls_device_sendpage(struct sock *sk, struct page *page,
goto out;
}
- kaddr = kmap(page);
+ kaddr = kmap_thread(page);
iov.iov_base = kaddr + offset;
iov.iov_len = size;
iov_iter_kvec(&msg_iter, WRITE, &iov, 1, size);
rc = tls_push_data(sk, &msg_iter, size,
flags, TLS_RECORD_TYPE_DATA);
- kunmap(page);
+ kunmap_thread(page);
out:
release_sock(sk);
--
2.28.0.rc0.12.gb6a658bd00c9
Powered by blists - more mailing lists