Displaying 20 results from an estimated 107 matches for "max_t".
Did you mean:
max_e
2020 Jun 08
4
[PATCH] virtio_mem: prevent overflow with subblock size
...* The number of subblocks per memory block. */
uint32_t nb_sb_per_mb;
@@ -1698,9 +1698,9 @@ static int virtio_mem_init(struct virtio_mem *vm)
* - At least the device block size.
* In the worst case, a single subblock per memory block.
*/
- vm->subblock_size = PAGE_SIZE * 1u << max_t(uint32_t, MAX_ORDER - 1,
- pageblock_order);
- vm->subblock_size = max_t(uint32_t, vm->device_block_size,
+ vm->subblock_size = PAGE_SIZE * 1ul << max_t(uint32_t, MAX_ORDER - 1,
+ pageblock_order);
+ vm->subblock_size = max_t(uint64_t, vm->device_block_size,...
2020 Jun 08
4
[PATCH] virtio_mem: prevent overflow with subblock size
...* The number of subblocks per memory block. */
uint32_t nb_sb_per_mb;
@@ -1698,9 +1698,9 @@ static int virtio_mem_init(struct virtio_mem *vm)
* - At least the device block size.
* In the worst case, a single subblock per memory block.
*/
- vm->subblock_size = PAGE_SIZE * 1u << max_t(uint32_t, MAX_ORDER - 1,
- pageblock_order);
- vm->subblock_size = max_t(uint32_t, vm->device_block_size,
+ vm->subblock_size = PAGE_SIZE * 1ul << max_t(uint32_t, MAX_ORDER - 1,
+ pageblock_order);
+ vm->subblock_size = max_t(uint64_t, vm->device_block_size,...
2020 Jun 08
0
[PATCH] virtio_mem: prevent overflow with subblock size
...y block. */
> uint32_t nb_sb_per_mb;
>
> @@ -1698,9 +1698,9 @@ static int virtio_mem_init(struct virtio_mem *vm)
> * - At least the device block size.
> * In the worst case, a single subblock per memory block.
> */
> - vm->subblock_size = PAGE_SIZE * 1u << max_t(uint32_t, MAX_ORDER - 1,
> - pageblock_order);
> - vm->subblock_size = max_t(uint32_t, vm->device_block_size,
> + vm->subblock_size = PAGE_SIZE * 1ul << max_t(uint32_t, MAX_ORDER - 1,
> + pageblock_order);
> + vm->subblock_size = max_t(uint64_t, v...
2020 Jun 08
2
[PATCH] virtio_mem: prevent overflow with subblock size
..._sb_per_mb;
> >
> > @@ -1698,9 +1698,9 @@ static int virtio_mem_init(struct virtio_mem *vm)
> > * - At least the device block size.
> > * In the worst case, a single subblock per memory block.
> > */
> > - vm->subblock_size = PAGE_SIZE * 1u << max_t(uint32_t, MAX_ORDER - 1,
> > - pageblock_order);
> > - vm->subblock_size = max_t(uint32_t, vm->device_block_size,
> > + vm->subblock_size = PAGE_SIZE * 1ul << max_t(uint32_t, MAX_ORDER - 1,
> > + pageblock_order);
> > + vm->subblock...
2020 Jun 08
2
[PATCH] virtio_mem: prevent overflow with subblock size
..._sb_per_mb;
> >
> > @@ -1698,9 +1698,9 @@ static int virtio_mem_init(struct virtio_mem *vm)
> > * - At least the device block size.
> > * In the worst case, a single subblock per memory block.
> > */
> > - vm->subblock_size = PAGE_SIZE * 1u << max_t(uint32_t, MAX_ORDER - 1,
> > - pageblock_order);
> > - vm->subblock_size = max_t(uint32_t, vm->device_block_size,
> > + vm->subblock_size = PAGE_SIZE * 1ul << max_t(uint32_t, MAX_ORDER - 1,
> > + pageblock_order);
> > + vm->subblock...
2010 Dec 14
0
[PATCH 1/5] vtdt: Define a new function gtsc_to_gtime()
...rch/x86/time.c Thu Dec 09 22:32:51 2010 +0800
@@ -1634,11 +1634,20 @@ static void __init tsc_parse(const char
}
custom_param("tsc", tsc_parse);
-u64 gtime_to_gtsc(struct domain *d, u64 tsc)
+u64 gtime_to_gtsc(struct domain *d, u64 time)
{
if ( !is_hvm_domain(d) )
- tsc = max_t(s64, tsc - d->arch.vtsc_offset, 0);
- return scale_delta(tsc, &d->arch.ns_to_vtsc);
+ time = max_t(s64, time - d->arch.vtsc_offset, 0);
+ return scale_delta(time, &d->arch.ns_to_vtsc);
+}
+
+u64 gtsc_to_gtime(struct domain *d, u64 tsc)
+{
+ u64 time = scale_delta...
2010 Dec 12
0
[PATCH] Btrfs: pick the correct metadata allocation size on small devices
...ld_alloc_chunk(struct btrfs_root *root,
alloc_bytes < div_factor(num_bytes, 8))
return 0;
+ max_chunk_size = min(256 * 1024 * 1024, div_factor(total_rw_bytes, 1));
thresh = btrfs_super_total_bytes(&root->fs_info->super_copy);
- thresh = max_t(u64, 256 * 1024 * 1024, div_factor_fine(thresh, 5));
+ thresh = max_t(u64, max_chunk_size, div_factor_fine(thresh, 5));
if (num_bytes > thresh && sinfo->bytes_used < div_factor(num_bytes, 3))
return 0;
--
Itaru Kitayama <kitayama@cl.bb4.ne.jp&g...
2013 Dec 17
15
[PATCH net-next 1/3] net: allow > 0 order atomic page alloc in skb_page_frag_refill
skb_page_frag_refill currently permits only order-0 page allocs
unless GFP_WAIT is used. Change skb_page_frag_refill to attempt
higher-order page allocations whether or not GFP_WAIT is used. If
memory cannot be allocated, the allocator will fall back to
successively smaller page allocs (down to order-0 page allocs).
This change brings skb_page_frag_refill in line with the existing
page allocation
2013 Dec 17
15
[PATCH net-next 1/3] net: allow > 0 order atomic page alloc in skb_page_frag_refill
skb_page_frag_refill currently permits only order-0 page allocs
unless GFP_WAIT is used. Change skb_page_frag_refill to attempt
higher-order page allocations whether or not GFP_WAIT is used. If
memory cannot be allocated, the allocator will fall back to
successively smaller page allocs (down to order-0 page allocs).
This change brings skb_page_frag_refill in line with the existing
page allocation
2004 Jun 17
2
[PATCH] (3/4) delay scheduler race with device stopped
The delay scheduler dequeue routine has some code cut&pasted from the TBF scheduler
that caused a race with E1000 when ring got full.
It looks like net schedulers should never be calling netif_queue_stopped because
the queue may get unstopped by interrrupt or receive soft irq (NAPI) which races
with the dequeue in the transmit scheduler.
Also, if requeuing the packet fails, it is probably
2023 Mar 02
1
[PATCH] ocfs2: Fix data corruption after failed write
...nd_nolock(struct address_space *mapping,
}
if (unlikely(copied < len) && wc->w_target_page) {
+ loff_t new_isize;
+
if (!PageUptodate(wc->w_target_page))
copied = 0;
- ocfs2_zero_new_buffers(wc->w_target_page, start+copied,
- start+len);
+ new_isize = max_t(loff_t, i_size_read(inode), pos + copied);
+ if (new_isize > page_offset(wc->w_target_page))
+ ocfs2_zero_new_buffers(wc->w_target_page, start+copied,
+ start+len);
+ else {
+ /*
+ * When page is fully beyond new isize (data copy
+ * failed), do not bother zeroing th...
2023 Mar 30
2
[PATCH] drm/nouveau/disp: Support more modes by checking with lower bpc
...*mode = &asyh->state.adjusted_mode;
+ unsigned int max_rate, mode_rate;
+
+ switch (nv_encoder->dcb->type) {
+ case DCB_OUTPUT_DP:
+ max_rate = nv_encoder->dp.link_nr * nv_encoder->dp.link_bw;
+
+ /* we don't support more than 10 anyway */
+ asyh->or.bpc = max_t(u8, asyh->or.bpc, 10);
+
+ /* reduce the bpc until it works out */
+ while (asyh->or.bpc > 6) {
+ mode_rate = DIV_ROUND_UP(mode->clock * asyh->or.bpc * 3, 8);
+ if (mode_rate <= max_rate)
+ break;
+
+ asyh->or.bpc -= 2;
+ }
+ break;
+ default:
+ break;
+ }
+}
+
s...
2019 Jun 11
1
[PATCH] drm/virtio: drop framebuffer dirty tracking code
...gt;base.height;
- }
- left = clips->x1;
- right = clips->x2;
- top = clips->y1;
- bottom = clips->y2;
-
- /* skip the first clip rect */
- for (i = 1, clips_ptr = clips + inc;
- i < num_clips; i++, clips_ptr += inc) {
- left = min_t(int, left, (int)clips_ptr->x1);
- right = max_t(int, right, (int)clips_ptr->x2);
- top = min_t(int, top, (int)clips_ptr->y1);
- bottom = max_t(int, bottom, (int)clips_ptr->y2);
- }
-
- if (obj->dumb)
- return virtio_gpu_dirty_update(vgfb, false, left, top,
- right - left, bottom - top);
-
- virtio_gpu_cmd_resource_flush...
2023 Mar 20
2
FAILED: patch "[PATCH] ocfs2: fix data corruption after failed write" failed to apply to 5.10-stable tree
...nd_nolock(struct address_space *mapping,
}
if (unlikely(copied < len) && wc->w_target_page) {
+ loff_t new_isize;
+
if (!PageUptodate(wc->w_target_page))
copied = 0;
- ocfs2_zero_new_buffers(wc->w_target_page, start+copied,
- start+len);
+ new_isize = max_t(loff_t, i_size_read(inode), pos + copied);
+ if (new_isize > page_offset(wc->w_target_page))
+ ocfs2_zero_new_buffers(wc->w_target_page, start+copied,
+ start+len);
+ else {
+ /*
+ * When page is fully beyond new isize (data copy
+ * failed), do not bother zeroing th...
2013 Dec 17
0
[PATCH net-next 2/3] virtio-net: use per-receive queue page frag alloc for mergeable bufs
...struct sk_buff *receive_mergeable(struct net_device *dev,
int num_buf = hdr->mhdr.num_buffers;
struct page *page = virt_to_head_page(buf);
int offset = buf - page_address(page);
- struct sk_buff *head_skb = page_to_skb(rq, page, offset, len,
- MERGE_BUFFER_LEN);
+ int truesize = max_t(int, len, MERGE_BUFFER_LEN);
+ struct sk_buff *head_skb = page_to_skb(rq, page, offset, len, truesize);
struct sk_buff *curr_skb = head_skb;
if (unlikely(!curr_skb))
@@ -353,11 +356,6 @@ static struct sk_buff *receive_mergeable(struct net_device *dev,
dev->stats.rx_length_errors++;...
2014 Jan 16
0
[PATCH net-next v4 2/6] virtio-net: use per-receive queue page frag alloc for mergeable bufs
..._buff *receive_mergeable(struct net_device *dev,
int num_buf = hdr->mhdr.num_buffers;
struct page *page = virt_to_head_page(buf);
int offset = buf - page_address(page);
- struct sk_buff *head_skb = page_to_skb(rq, page, offset, len,
- MERGE_BUFFER_LEN);
+ unsigned int truesize = max_t(unsigned int, len, MERGE_BUFFER_LEN);
+ struct sk_buff *head_skb = page_to_skb(rq, page, offset, len, truesize);
struct sk_buff *curr_skb = head_skb;
if (unlikely(!curr_skb))
@@ -353,11 +351,6 @@ static struct sk_buff *receive_mergeable(struct net_device *dev,
dev->stats.rx_length_erro...
2013 Nov 12
0
[PATCH net-next 3/4] virtio-net: use per-receive queue page frag alloc for mergeable bufs
...e *rq, struct sk_buff *head_skb)
head_skb->dev->stats.rx_length_errors++;
return -EINVAL;
}
- if (unlikely(len > MERGE_BUFFER_LEN)) {
- pr_debug("%s: rx error: merge buffer too long\n",
- head_skb->dev->name);
- len = MERGE_BUFFER_LEN;
- }
+ truesize = max_t(int, len, MERGE_BUFFER_LEN);
if (unlikely(num_skb_frags == MAX_SKB_FRAGS)) {
struct sk_buff *nskb = alloc_skb(0, GFP_ATOMIC);
if (unlikely(!nskb)) {
@@ -339,17 +338,17 @@ static int receive_mergeable(struct receive_queue *rq, struct sk_buff *head_skb)
if (curr_skb != head_skb) {
h...
2023 Mar 20
1
FAILED: patch "[PATCH] ocfs2: fix data corruption after failed write" failed to apply to 4.19-stable tree
...nd_nolock(struct address_space *mapping,
}
if (unlikely(copied < len) && wc->w_target_page) {
+ loff_t new_isize;
+
if (!PageUptodate(wc->w_target_page))
copied = 0;
- ocfs2_zero_new_buffers(wc->w_target_page, start+copied,
- start+len);
+ new_isize = max_t(loff_t, i_size_read(inode), pos + copied);
+ if (new_isize > page_offset(wc->w_target_page))
+ ocfs2_zero_new_buffers(wc->w_target_page, start+copied,
+ start+len);
+ else {
+ /*
+ * When page is fully beyond new isize (data copy
+ * failed), do not bother zeroing th...
2020 Nov 02
0
[PATCH mlx5-next v1 03/11] net/mlx5_core: Clean driver version and name
...lx5_core_debug_mask;
> > module_param_named(debug_mask, mlx5_core_debug_mask, uint, 0644);
> > @@ -228,7 +227,7 @@ static void mlx5_set_driver_version(struct
> > mlx5_core_dev *dev)
> > strncat(string, ",", remaining_size);
> >
> > remaining_size = max_t(int, 0, driver_ver_sz - strlen(string));
> > - strncat(string, DRIVER_NAME, remaining_size);
> > + strncat(string, KBUILD_MODNAME, remaining_size);
> >
> > remaining_size = max_t(int, 0, driver_ver_sz - strlen(string));
> > strncat(string, ",", remaining_...
2013 Nov 13
4
[PATCH net-next 4/4] virtio-net: auto-tune mergeable rx buffer size for improved performance
...while (--num_buf) {
> int num_skb_frags = skb_shinfo(curr_skb)->nr_frags;
> @@ -320,7 +325,6 @@ static int receive_mergeable(struct receive_queue *rq, struct sk_buff *head_skb)
> head_skb->dev->stats.rx_length_errors++;
> return -EINVAL;
> }
> - truesize = max_t(int, len, MERGE_BUFFER_LEN);
> if (unlikely(num_skb_frags == MAX_SKB_FRAGS)) {
> struct sk_buff *nskb = alloc_skb(0, GFP_ATOMIC);
> if (unlikely(!nskb)) {
> @@ -338,20 +342,38 @@ static int receive_mergeable(struct receive_queue *rq, struct sk_buff *head_skb)
> if (curr...