summaryrefslogtreecommitdiff
path: root/include/linux/dynamic_queue_limits.h
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>2014-10-21 14:32:51 +0400
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2014-10-21 14:32:51 +0400
commit1ef24960ab78554fe7e8e77d8fc86524fbd60d3c (patch)
treeb794f25550b7dbbe9cc8eda81633df9023b4821c /include/linux/dynamic_queue_limits.h
parent5563caaf8b8cd22e35997d5d74cb3609df86b223 (diff)
parentf114040e3ea6e07372334ade75d1ee0775c355e1 (diff)
downloadlinux-1ef24960ab78554fe7e8e77d8fc86524fbd60d3c.tar.xz
Merge tag 'v3.18-rc1' into patchwork
Linux 3.18-rc1 * tag 'v3.18-rc1': (9526 commits) Linux 3.18-rc1 MAINTAINERS: corrected bcm2835 search Net: DSA: Fix checking for get_phy_flags function sparc64: Do not define thread fpregs save area as zero-length array. sparc64: Fix corrupted thread fault code. MAINTAINERS: Become the docs maintainer x86,kvm,vmx: Preserve CR4 across VM entry ipv6: fix a potential use after free in sit.c ipv6: fix a potential use after free in ip6_offload.c ipv4: fix a potential use after free in gre_offload.c tcp: fix build error if IPv6 is not enabled futex: Ensure get_futex_key_refs() always implies a barrier bna: fix skb->truesize underestimation net: dsa: add includes for ethtool and phy_fixed definitions openvswitch: Set flow-key members. netrom: use linux/uaccess.h dsa: Fix conversion from host device to mii bus tipc: fix bug in bundled buffer reception ipv6: introduce tcp_v6_iif() sfc: add support for skb->xmit_more ...
Diffstat (limited to 'include/linux/dynamic_queue_limits.h')
-rw-r--r--include/linux/dynamic_queue_limits.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/include/linux/dynamic_queue_limits.h b/include/linux/dynamic_queue_limits.h
index 5621547d631b..a4be70398ce1 100644
--- a/include/linux/dynamic_queue_limits.h
+++ b/include/linux/dynamic_queue_limits.h
@@ -73,14 +73,22 @@ static inline void dql_queued(struct dql *dql, unsigned int count)
{
BUG_ON(count > DQL_MAX_OBJECT);
- dql->num_queued += count;
dql->last_obj_cnt = count;
+
+ /* We want to force a write first, so that cpu do not attempt
+ * to get cache line containing last_obj_cnt, num_queued, adj_limit
+ * in Shared state, but directly does a Request For Ownership
+ * It is only a hint, we use barrier() only.
+ */
+ barrier();
+
+ dql->num_queued += count;
}
/* Returns how many objects can be queued, < 0 indicates over limit. */
static inline int dql_avail(const struct dql *dql)
{
- return dql->adj_limit - dql->num_queued;
+ return ACCESS_ONCE(dql->adj_limit) - ACCESS_ONCE(dql->num_queued);
}
/* Record number of completed objects and recalculate the limit. */