search for: page_size

Displaying 20 results from an estimated 2613 matches for "page_size".

2019 Aug 15
2
[nbdkit PATCH] data, memory: Optimize .zero > PAGE_SIZE
.../sparse.c b/common/sparse/sparse.c index cb44743c..5e085763 100644 --- a/common/sparse/sparse.c +++ b/common/sparse/sparse.c @@ -343,10 +343,13 @@ sparse_array_zero (struct sparse_array *sa, uint32_t count, uint64_t offset) n = count; if (p) { - memset (p, 0, n); + if (n < PAGE_SIZE) + memset (p, 0, n); + else + assert (p == *l2_page); /* If the whole page is now zero, free it. */ - if (is_zero (*l2_page, PAGE_SIZE)) { + if (n == PAGE_SIZE || is_zero (*l2_page, PAGE_SIZE)) { if (sa->debug) nbdkit_debug ("%s: free...
2012 Apr 03
3
[PATCH] Btrfs: do not mount when we have a sectorsize unequal to PAGE_SIZE
Our code is not ready to cope with a sectorsize that''s not equal to PAGE_SIZE. It will lead to hanging-on while writing something. Signed-off-by: Liu Bo <liubo2009@cn.fujitsu.com> --- fs/btrfs/disk-io.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 20196f4..b9866f2 100644 --- a/fs/btrfs/dis...
2010 Dec 09
1
[PATCH 1/1] Properly check return values of kmalloc and vmbus_recvpacket
...*context) { struct vmbus_channel *channel = context; u8 *buf; - u32 buflen, recvlen; + u32 recvlen; u64 requestid; u8 execute_shutdown = false; + int ret = 0; struct shutdown_msg_data *shutdown_msg; struct icmsg_hdr *icmsghdrp; struct icmsg_negotiate *negop = NULL; - buflen = PAGE_SIZE; - buf = kmalloc(buflen, GFP_ATOMIC); + buf = kmalloc(PAGE_SIZE, GFP_ATOMIC); - vmbus_recvpacket(channel, buf, buflen, &recvlen, &requestid); + if (!buf) { + printk(KERN_INFO + "Unable to allocate memory for shutdown_onchannelcallback"); + return; + } + + ret = vmbus_r...
2010 Dec 09
1
[PATCH 1/1] Properly check return values of kmalloc and vmbus_recvpacket
...*context) { struct vmbus_channel *channel = context; u8 *buf; - u32 buflen, recvlen; + u32 recvlen; u64 requestid; u8 execute_shutdown = false; + int ret = 0; struct shutdown_msg_data *shutdown_msg; struct icmsg_hdr *icmsghdrp; struct icmsg_negotiate *negop = NULL; - buflen = PAGE_SIZE; - buf = kmalloc(buflen, GFP_ATOMIC); + buf = kmalloc(PAGE_SIZE, GFP_ATOMIC); - vmbus_recvpacket(channel, buf, buflen, &recvlen, &requestid); + if (!buf) { + printk(KERN_INFO + "Unable to allocate memory for shutdown_onchannelcallback"); + return; + } + + ret = vmbus_r...
2013 Jul 10
13
[PATCH v2 1/1] xen/netback: correctly calculate required slots of skb.
...uct sk_buff *skb) +static int netbk_count_slots(struct xenvif *vif, struct sk_buff *skb, + int *copy_off, unsigned long size, + unsigned long offset, int *head) { - unsigned int count; - int i, copy_off; + unsigned long bytes; + int count = 0; - count = DIV_ROUND_UP(skb_headlen(skb), PAGE_SIZE); + offset &= ~PAGE_MASK; - copy_off = skb_headlen(skb) % PAGE_SIZE; + while (size > 0) { + BUG_ON(offset >= PAGE_SIZE); + BUG_ON(*copy_off > MAX_BUFFER_OFFSET); - if (skb_shinfo(skb)->gso_size) - count++; + bytes = PAGE_SIZE - offset; - for (i = 0; i < skb_shinfo(skb)-...
2018 Apr 18
1
[PATCH 1/2] qxl: fix qxl_release_{map,unmap}
s/PAGE_SIZE/PAGE_MASK/ Luckily release_offset is never larger than PAGE_SIZE, so the bug has no bad side effects and managed to stay unnoticed for years that way ... Signed-off-by: Gerd Hoffmann <kraxel at redhat.com> --- drivers/gpu/drm/qxl/qxl_ioctl.c | 4 ++-- drivers/gpu/drm/qxl/qxl_release.c |...
2010 Dec 13
3
[PATCH 1/1] hv: Use only one receive buffer per channel and kmalloc on initialize
...struct vmbus_channel *channel = context; - u8 *buf; - u32 buflen, recvlen; + u32 recvlen; u64 requestid; u8 execute_shutdown = false; @@ -52,24 +54,23 @@ static void shutdown_onchannelcallback(void *context) struct icmsg_hdr *icmsghdrp; struct icmsg_negotiate *negop = NULL; - buflen = PAGE_SIZE; - buf = kmalloc(buflen, GFP_ATOMIC); - - vmbus_recvpacket(channel, buf, buflen, &recvlen, &requestid); + vmbus_recvpacket(channel, shut_txf_buf, + PAGE_SIZE, &recvlen, &requestid); if (recvlen > 0) { DPRINT_DBG(VMBUS, "shutdown packet: len=%d, requestid=%lld"...
2010 Dec 13
3
[PATCH 1/1] hv: Use only one receive buffer per channel and kmalloc on initialize
...struct vmbus_channel *channel = context; - u8 *buf; - u32 buflen, recvlen; + u32 recvlen; u64 requestid; u8 execute_shutdown = false; @@ -52,24 +54,23 @@ static void shutdown_onchannelcallback(void *context) struct icmsg_hdr *icmsghdrp; struct icmsg_negotiate *negop = NULL; - buflen = PAGE_SIZE; - buf = kmalloc(buflen, GFP_ATOMIC); - - vmbus_recvpacket(channel, buf, buflen, &recvlen, &requestid); + vmbus_recvpacket(channel, shut_txf_buf, + PAGE_SIZE, &recvlen, &requestid); if (recvlen > 0) { DPRINT_DBG(VMBUS, "shutdown packet: len=%d, requestid=%lld"...
2019 Aug 15
0
Re: [nbdkit PATCH] data, memory: Optimize .zero > PAGE_SIZE
...cb44743c..5e085763 100644 > --- a/common/sparse/sparse.c > +++ b/common/sparse/sparse.c > @@ -343,10 +343,13 @@ sparse_array_zero (struct sparse_array *sa, uint32_t count, uint64_t offset) > n = count; > > if (p) { > - memset (p, 0, n); > + if (n < PAGE_SIZE) > + memset (p, 0, n); > + else > + assert (p == *l2_page); > > /* If the whole page is now zero, free it. */ > - if (is_zero (*l2_page, PAGE_SIZE)) { > + if (n == PAGE_SIZE || is_zero (*l2_page, PAGE_SIZE)) { Should this be n >= PAGE_SI...
2007 Apr 18
2
[PATCH 3/6] i386 virtualization - Make ldt a desc struct
...include/asm-i386/desc.h 2005-08-15 11:16:59.000000000 -0700 > +++ linux-2.6.13/include/asm-i386/desc.h 2005-08-15 11:19:49.000000000 -0700 > @@ -6,6 +6,9 @@ > > #define CPU_16BIT_STACK_SIZE 1024 > > +/* The number of LDT entries per page */ > +#define LDT_ENTRIES_PER_PAGE (PAGE_SIZE / LDT_ENTRY_SIZE) > + > #ifndef __ASSEMBLY__ > > #include <linux/preempt.h> > @@ -30,7 +33,7 @@ > static inline unsigned long get_desc_base(struct desc_struct *desc) > { > unsigned long base; > - base = ((desc->a >> 16) & 0x0000ffff) | > + b...
2007 Apr 18
2
[PATCH 3/6] i386 virtualization - Make ldt a desc struct
...include/asm-i386/desc.h 2005-08-15 11:16:59.000000000 -0700 > +++ linux-2.6.13/include/asm-i386/desc.h 2005-08-15 11:19:49.000000000 -0700 > @@ -6,6 +6,9 @@ > > #define CPU_16BIT_STACK_SIZE 1024 > > +/* The number of LDT entries per page */ > +#define LDT_ENTRIES_PER_PAGE (PAGE_SIZE / LDT_ENTRY_SIZE) > + > #ifndef __ASSEMBLY__ > > #include <linux/preempt.h> > @@ -30,7 +33,7 @@ > static inline unsigned long get_desc_base(struct desc_struct *desc) > { > unsigned long base; > - base = ((desc->a >> 16) & 0x0000ffff) | > + b...
2017 Jan 23
2
[PATCH v2] virtio_net: fix PAGE_SIZE > 64k
I don't have any guests with PAGE_SIZE > 64k but the code seems to be clearly broken in that case as PAGE_SIZE / MERGEABLE_BUFFER_ALIGN will need more than 8 bit and so the code in mergeable_ctx_to_buf_address does not give us the actual true size. Cc: John Fastabend <john.fastabend at gmail.com> Signed-off-by: Michael S. Tsir...
2017 Jan 23
2
[PATCH v2] virtio_net: fix PAGE_SIZE > 64k
I don't have any guests with PAGE_SIZE > 64k but the code seems to be clearly broken in that case as PAGE_SIZE / MERGEABLE_BUFFER_ALIGN will need more than 8 bit and so the code in mergeable_ctx_to_buf_address does not give us the actual true size. Cc: John Fastabend <john.fastabend at gmail.com> Signed-off-by: Michael S. Tsir...
2013 Aug 23
0
[PATCH 2/2] VMCI: Add support for virtual IOMMU
...dev *vmci_pdev; static struct vmci_guest_device *vmci_dev_g; static DEFINE_SPINLOCK(vmci_dev_spinlock); @@ -528,7 +530,9 @@ static int vmci_guest_probe_device(struct pci_dev *pdev, * well. */ if (capabilities & VMCI_CAPS_NOTIFICATIONS) { - vmci_dev->notification_bitmap = vmalloc(PAGE_SIZE); + vmci_dev->notification_bitmap = dma_alloc_coherent( + &pdev->dev, PAGE_SIZE, &vmci_dev->notification_base, + GFP_KERNEL); if (!vmci_dev->notification_bitmap) { dev_warn(&pdev->dev, "Unable to allocate notification bitmap\n"); @@ -546,6 +550...
2014 Sep 09
2
mutex
...V; list_for_each_entry(rng, &rng_list, list) { if (strcmp(rng->name, buf) == 0) { if (rng == current_rng) { @@ -270,8 +271,8 @@ static ssize_t hwrng_attr_current_show(struct device *dev, return -ERESTARTSYS; if (current_rng) name = current_rng->name; - ret = snprintf(buf, PAGE_SIZE, "%s\n", name); mutex_unlock(&rng_mutex); + ret = snprintf(buf, PAGE_SIZE, "%s\n", name); return ret; } @@ -284,19 +285,19 @@ static ssize_t hwrng_attr_available_show(struct device *dev, ssize_t ret = 0; struct hwrng *rng; + buf[0] = '\0'; err = mutex_...
2014 Sep 09
2
mutex
...V; list_for_each_entry(rng, &rng_list, list) { if (strcmp(rng->name, buf) == 0) { if (rng == current_rng) { @@ -270,8 +271,8 @@ static ssize_t hwrng_attr_current_show(struct device *dev, return -ERESTARTSYS; if (current_rng) name = current_rng->name; - ret = snprintf(buf, PAGE_SIZE, "%s\n", name); mutex_unlock(&rng_mutex); + ret = snprintf(buf, PAGE_SIZE, "%s\n", name); return ret; } @@ -284,19 +285,19 @@ static ssize_t hwrng_attr_available_show(struct device *dev, ssize_t ret = 0; struct hwrng *rng; + buf[0] = '\0'; err = mutex_...
2012 Jan 26
1
[PATCH] netback: fix multi page ring size calculation.
...changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/xen-netback/common.h b/drivers/net/xen-netback/common.h index 477e5ab..f3d95b3 100644 --- a/drivers/net/xen-netback/common.h +++ b/drivers/net/xen-netback/common.h @@ -60,9 +60,9 @@ struct xenvif_rx_meta { #define MAX_BUFFER_OFFSET PAGE_SIZE #define NETBK_TX_RING_SIZE(_nr_pages) \ - (__CONST_RING_SIZE(xen_netif_tx, PAGE_SIZE) * (_nr_pages)) + (__CONST_RING_SIZE(xen_netif_tx, PAGE_SIZE * (_nr_pages))) #define NETBK_RX_RING_SIZE(_nr_pages) \ - (__CONST_RING_SIZE(xen_netif_rx, PAGE_SIZE) * (_nr_pages)) + (__CONST_RING_SIZE(xen...
2005 May 31
0
[PATCH] Store page and evtchn in start_info_t
...) + unsigned int vcpus, + unsigned int store_evtchn, unsigned long *store_mfn) { l1_pgentry_t *vl1tab=NULL, *vl1e=NULL; l2_pgentry_t *vl2tab=NULL, *vl2e=NULL; @@ -108,7 +109,8 @@ { vpt_end = vpt_start + (nr_pt_pages * PAGE_SIZE); vstartinfo_start = vpt_end; - vstartinfo_end = vstartinfo_start + PAGE_SIZE; + /* Place store shared page after startinfo. */ + vstartinfo_end = vstartinfo_start + PAGE_SIZE * 2; vstack_start = vstartinfo_end; vstack_end = vstack_start...
2023 Mar 28
1
[PATCH net-next 2/8] virtio_net: mergeable xdp: introduce mergeable_xdp_prepare
...t page *xdp_page; + unsigned int xdp_room; + + /* Transient failure which in theory could occur if + * in-flight packets from before XDP was enabled reach + * the receive path after XDP is loaded. + */ + if (unlikely(hdr->hdr.gso_type)) + return NULL; + + /* Now XDP core assumes frag size is PAGE_SIZE, but buffers + * with headroom may add hole in truesize, which + * make their length exceed PAGE_SIZE. So we disabled the + * hole mechanism for xdp. See add_recvbuf_mergeable(). + */ + *frame_sz = truesize; + + /* This happens when headroom is not enough because + * of the buffer was prefille...
2013 Jan 04
31
xennet: skb rides the rocket: 20 slots
...39;t have enough knowledge if this could/should be prevented from happening ? [16798.629141] xennet: skb rides the rocket: 19 slots MAX_SKB_FRAGS: 17 div_roundup:1 xennet_count_skb_frag_slots:18 offset:106 skb_headlen:1622 skb->len:64294, skb->data_len:62672 skb->truesize:64976 nr_frags:4 page_size:4096 prot:0800 [16800.575182] xennet: skb rides the rocket: 19 slots MAX_SKB_FRAGS: 17 div_roundup:1 xennet_count_skb_frag_slots:18 offset:2154 skb_headlen:1622 skb->len:64294, skb->data_len:62672 skb->truesize:64976 nr_frags:4 page_size:4096 prot:0800 [16801.589166] xennet: skb rides the...