search for: for_each_possible_cpu

Displaying 20 results from an estimated 153 matches for "for_each_possible_cpu".

2009 Jul 15
0
[PATCH] rename for_each_cpu() to for_each_possible_cpu()
...m> --- 2009-07-10.orig/xen/arch/ia64/linux-xen/perfmon.c 2009-05-27 13:54:05.000000000 +0200 +++ 2009-07-10/xen/arch/ia64/linux-xen/perfmon.c 2009-07-15 10:02:08.000000000 +0200 @@ -7313,7 +7313,7 @@ xenpfm_context_create(XEN_GUEST_HANDLE(p goto out; /* XXX fmt */ - for_each_cpu(cpu) { + for_each_possible_cpu(cpu) { ctx[cpu] = pfm_context_create(&kreq); if (ctx[cpu] == NULL) { error = -ENOMEM; @@ -7325,20 +7325,20 @@ xenpfm_context_create(XEN_GUEST_HANDLE(p BUG_ON(in_irq()); spin_lock(&xenpfm_context_lock); - for_each_cpu(cpu) { + for_each_possible_cpu(cpu) { if (per_cpu(xenpf...
2012 Jun 05
1
[net-next RFC PATCH] virtio_net: collect satistics and export through ethtool
...drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) { @@ -939,10 +996,77 @@ static void virtnet_get_drvinfo(struct net_device *dev, } +static void virtnet_get_strings(struct net_device *dev, u32 stringset, u8 *buf) +{ + int i, cpu; + switch (stringset) { + case ETH_SS_STATS: + for_each_possible_cpu(cpu) + for (i = 0; i < VIRTNET_NUM_STATS; i++) { + sprintf(buf, "%s[%u]", + virtnet_stats_str_attr[i].string, cpu); + buf += ETH_GSTRING_LEN; + } + for (i = 0; i < VIRTNET_NUM_STATS; i++) { + memcpy(buf, virtnet_stats_str_attr[i].string, + ETH_GSTRING_LEN); + b...
2012 Jun 05
1
[net-next RFC PATCH] virtio_net: collect satistics and export through ethtool
...drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) { @@ -939,10 +996,77 @@ static void virtnet_get_drvinfo(struct net_device *dev, } +static void virtnet_get_strings(struct net_device *dev, u32 stringset, u8 *buf) +{ + int i, cpu; + switch (stringset) { + case ETH_SS_STATS: + for_each_possible_cpu(cpu) + for (i = 0; i < VIRTNET_NUM_STATS; i++) { + sprintf(buf, "%s[%u]", + virtnet_stats_str_attr[i].string, cpu); + buf += ETH_GSTRING_LEN; + } + for (i = 0; i < VIRTNET_NUM_STATS; i++) { + memcpy(buf, virtnet_stats_str_attr[i].string, + ETH_GSTRING_LEN); + b...
2015 Mar 19
0
[PATCH 8/9] qspinlock: Generic paravirt support
...de, but yes I missed that. > >+ /* > >+ * At this point the memory pointed at by lock can be freed/reused, > >+ * however we can still use the pointer value to search in our cpu > >+ * array. > >+ * > >+ * XXX: get rid of this loop > >+ */ > >+ for_each_possible_cpu(cpu) { > >+ if (per_cpu(__pv_lock_wait, cpu) == lock) > >+ pv_kick(cpu); > >+ } > >+} > > I do want to get rid of this loop too. On average, we have to scan about > half the number of CPUs available. So it isn't that different > performance-wise compared...
2015 Mar 19
0
[PATCH 8/9] qspinlock: Generic paravirt support
...de, but yes I missed that. > >+ /* > >+ * At this point the memory pointed at by lock can be freed/reused, > >+ * however we can still use the pointer value to search in our cpu > >+ * array. > >+ * > >+ * XXX: get rid of this loop > >+ */ > >+ for_each_possible_cpu(cpu) { > >+ if (per_cpu(__pv_lock_wait, cpu) == lock) > >+ pv_kick(cpu); > >+ } > >+} > > I do want to get rid of this loop too. On average, we have to scan about > half the number of CPUs available. So it isn't that different > performance-wise compared...
2015 Mar 18
2
[PATCH 8/9] qspinlock: Generic paravirt support
...amp;l->locked, 0) != _Q_SLOW_VAL) > + return; > + > + /* > + * At this point the memory pointed at by lock can be freed/reused, > + * however we can still use the pointer value to search in our cpu > + * array. > + * > + * XXX: get rid of this loop > + */ > + for_each_possible_cpu(cpu) { > + if (per_cpu(__pv_lock_wait, cpu) == lock) > + pv_kick(cpu); > + } > +} I do want to get rid of this loop too. On average, we have to scan about half the number of CPUs available. So it isn't that different performance-wise compared with my original idea of following...
2015 Mar 18
2
[PATCH 8/9] qspinlock: Generic paravirt support
...amp;l->locked, 0) != _Q_SLOW_VAL) > + return; > + > + /* > + * At this point the memory pointed at by lock can be freed/reused, > + * however we can still use the pointer value to search in our cpu > + * array. > + * > + * XXX: get rid of this loop > + */ > + for_each_possible_cpu(cpu) { > + if (per_cpu(__pv_lock_wait, cpu) == lock) > + pv_kick(cpu); > + } > +} I do want to get rid of this loop too. On average, we have to scan about half the number of CPUs available. So it isn't that different performance-wise compared with my original idea of following...
2010 Mar 12
2
[PATCH] Btrfs: force delalloc flushing when things get desperate
...fs_space_info *info, int soft) { DEFINE_WAIT(wait); u64 num_bytes; @@ -2895,6 +2895,12 @@ static void wait_on_flush(struct btrfs_root *root, struct btrfs_space_info *info break; } + if (!soft) { + spin_unlock(&info->lock); + schedule(); + continue; + } + free = 0; for_each_possible_cpu(i) { struct btrfs_reserved_space_pool *pool; @@ -2924,7 +2930,7 @@ static void wait_on_flush(struct btrfs_root *root, struct btrfs_space_info *info } static void flush_delalloc(struct btrfs_root *root, - struct btrfs_space_info *info) + struct btrfs_space_info *info, int soft) {...
2012 Jun 06
2
[V2 RFC net-next PATCH 1/2] virtio_net: convert the statistics into array
Currently, we store the statistics in the independent fields of virtnet_stats, this is not scalable when we want to add more counters. As suggested by Michael, this patch convert it to an array and use the enum as the index to access them. Signed-off-by: Jason Wang <jasowang at redhat.com> --- drivers/net/virtio_net.c | 30 +++++++++++++++++------------- 1 files changed, 17
2012 Jun 06
2
[V2 RFC net-next PATCH 1/2] virtio_net: convert the statistics into array
Currently, we store the statistics in the independent fields of virtnet_stats, this is not scalable when we want to add more counters. As suggested by Michael, this patch convert it to an array and use the enum as the index to access them. Signed-off-by: Jason Wang <jasowang at redhat.com> --- drivers/net/virtio_net.c | 30 +++++++++++++++++------------- 1 files changed, 17
2011 Jun 15
3
[PATCH] virtio-net: per cpu 64 bit stats
..._skb_any(skb); } @@ -641,6 +662,40 @@ static int virtnet_set_mac_address(struc return 0; } +static struct rtnl_link_stats64 *virtnet_stats(struct net_device *dev, + struct rtnl_link_stats64 *tot) +{ + struct virtnet_info *vi = netdev_priv(dev); + int cpu; + unsigned int start; + + for_each_possible_cpu(cpu) { + struct virtnet_stats __percpu *stats + = per_cpu_ptr(vi->stats, cpu); + u64 tpackets, tbytes, rpackets, rbytes; + + do { + start = u64_stats_fetch_begin(&stats->syncp); + tpackets = stats->tx_packets; + tbytes = stats->tx_bytes; + rpackets = stats->rx_pack...
2011 Jun 15
3
[PATCH] virtio-net: per cpu 64 bit stats
..._skb_any(skb); } @@ -641,6 +662,40 @@ static int virtnet_set_mac_address(struc return 0; } +static struct rtnl_link_stats64 *virtnet_stats(struct net_device *dev, + struct rtnl_link_stats64 *tot) +{ + struct virtnet_info *vi = netdev_priv(dev); + int cpu; + unsigned int start; + + for_each_possible_cpu(cpu) { + struct virtnet_stats __percpu *stats + = per_cpu_ptr(vi->stats, cpu); + u64 tpackets, tbytes, rpackets, rbytes; + + do { + start = u64_stats_fetch_begin(&stats->syncp); + tpackets = stats->tx_packets; + tbytes = stats->tx_bytes; + rpackets = stats->rx_pack...
2020 Jul 02
1
[PATCH 6/8] powerpc/pseries: implement paravirt qspinlocks for SPLPAR
...ile_inode(file)->i_private; fb346fd9fc081c Waiman Long 2019-04-04 72 fb346fd9fc081c Waiman Long 2019-04-04 73 if (id >= lockevent_num) fb346fd9fc081c Waiman Long 2019-04-04 74 return -EBADF; fb346fd9fc081c Waiman Long 2019-04-04 75 fb346fd9fc081c Waiman Long 2019-04-04 76 for_each_possible_cpu(cpu) fb346fd9fc081c Waiman Long 2019-04-04 77 sum += per_cpu(lockevents[id], cpu); fb346fd9fc081c Waiman Long 2019-04-04 78 len = snprintf(buf, sizeof(buf) - 1, "%llu\n", sum); fb346fd9fc081c Waiman Long 2019-04-04 79 fb346fd9fc081c Waiman Long 2019-04-04 80 return simple...
2023 Jul 31
1
[PATCH] virtio: a new vcpu watchdog driver
...et = -ENOMEM; > + goto err; > + } > + vdev->priv = vcpu_stall; > + > + vcpu_stall->priv = devm_alloc_percpu(&vdev->dev, > + typeof(struct vcpu_stall_priv)); > + if (!vcpu_stall->priv) { > + ret = -ENOMEM; > + goto failed_priv; > + } > + > + for_each_possible_cpu(cpu) { > + struct vcpu_stall_priv *priv; > + > + priv = per_cpu_ptr(vcpu_stall->priv, cpu); > + priv->vdev = vdev; > + } > + > + ret = virtio_cread_feature(vdev, VCPU_STALL_REG_CLOCK_FREQ_HZ, > + struct vcpu_stall_detect_config, clock_freq_hz, > + &...
2018 Jan 17
1
[PATCH v2 net-next] virtio_net: Add ethtool stats
...nd(&sq->stats.syncp); } static void virtnet_poll_cleantx(struct receive_queue *rq) @@ -1474,24 +1495,25 @@ static void virtnet_stats(struct net_device *dev, struct rtnl_link_stats64 *tot) { struct virtnet_info *vi = netdev_priv(dev); - int cpu; unsigned int start; + int i; - for_each_possible_cpu(cpu) { - struct virtnet_stats *stats = per_cpu_ptr(vi->stats, cpu); + for (i = 0; i < vi->max_queue_pairs; i++) { u64 tpackets, tbytes, rpackets, rbytes; + struct receive_queue *rq = &vi->rq[i]; + struct send_queue *sq = &vi->sq[i]; do { - start = u64_stats_fetch...
2017 Dec 20
4
[PATCH net-next] virtio_net: Add ethtool stats
...nd(&sq->stats.syncp); } static void virtnet_poll_cleantx(struct receive_queue *rq) @@ -1463,24 +1478,24 @@ static void virtnet_stats(struct net_device *dev, struct rtnl_link_stats64 *tot) { struct virtnet_info *vi = netdev_priv(dev); - int cpu; unsigned int start; + int i; - for_each_possible_cpu(cpu) { - struct virtnet_stats *stats = per_cpu_ptr(vi->stats, cpu); + for (i = 0; i < vi->max_queue_pairs; i++) { u64 tpackets, tbytes, rpackets, rbytes; + struct receive_queue *rq = &vi->rq[i]; + struct send_queue *sq = &vi->sq[i]; do { - start = u64_stats_fetch...
2017 Dec 20
4
[PATCH net-next] virtio_net: Add ethtool stats
...nd(&sq->stats.syncp); } static void virtnet_poll_cleantx(struct receive_queue *rq) @@ -1463,24 +1478,24 @@ static void virtnet_stats(struct net_device *dev, struct rtnl_link_stats64 *tot) { struct virtnet_info *vi = netdev_priv(dev); - int cpu; unsigned int start; + int i; - for_each_possible_cpu(cpu) { - struct virtnet_stats *stats = per_cpu_ptr(vi->stats, cpu); + for (i = 0; i < vi->max_queue_pairs; i++) { u64 tpackets, tbytes, rpackets, rbytes; + struct receive_queue *rq = &vi->rq[i]; + struct send_queue *sq = &vi->sq[i]; do { - start = u64_stats_fetch...
2007 Apr 18
2
[Bridge] Re: [RESEND][PATCH] ebtables: clean up vmalloc usage in net/bridge/netfilter/ebtables.c
...(struct ebt_chainstack **) - vmalloc((highest_possible_processor_id()+1) - * sizeof(struct ebt_chainstack)); + newinfo->chainstack = + vmalloc((highest_possible_processor_id()+1) + * sizeof(*(newinfo->chainstack))); if (!newinfo->chainstack) return -ENOMEM; for_each_possible_cpu(i) {
2020 Feb 11
0
[PATCH 35/62] x86/sev-es: Setup per-cpu GHCBs for the runtime handler
...rly_forward_exception */ extern void early_exception(struct pt_regs *regs, int trapnr); @@ -133,6 +139,23 @@ static bool __init setup_ghcb(void) return true; } +void encrypted_state_init_ghcbs(void) +{ + int cpu; + + if (!sev_es_active()) + return; + + /* Initialize per-cpu GHCB pages */ + for_each_possible_cpu(cpu) { + struct ghcb *ghcb = &per_cpu(ghcb_page, cpu); + + set_memory_decrypted((unsigned long)ghcb, + sizeof(ghcb_page) >> PAGE_SHIFT); + memset(ghcb, 0, sizeof(*ghcb)); + } +} + static void __init early_forward_exception(struct es_em_ctxt *ctxt) { int trapnr = ctxt->fi...
2015 Apr 02
3
[PATCH 8/9] qspinlock: Generic paravirt support
On Thu, Apr 02, 2015 at 12:28:30PM -0400, Waiman Long wrote: > On 04/01/2015 05:03 PM, Peter Zijlstra wrote: > >On Wed, Apr 01, 2015 at 03:58:58PM -0400, Waiman Long wrote: > >>On 04/01/2015 02:48 PM, Peter Zijlstra wrote: > >>I am sorry that I don't quite get what you mean here. My point is that in > >>the hashing step, a cpu will need to scan an empty