lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <51505ED2.70208@redhat.com>
Date:	Mon, 25 Mar 2013 15:27:30 +0100
From:	Paolo Bonzini <pbonzini@...hat.com>
To:	Bart Van Assche <bvanassche@....org>
CC:	Wanlong Gao <gaowanlong@...fujitsu.com>,
	linux-scsi@...r.kernel.org, kvm@...r.kernel.org, mst@...hat.com,
	linux-kernel@...r.kernel.org, JBottomley@...allels.com,
	virtualization@...ts.linux-foundation.org
Subject: Re: [PATCH V7 4/5] virtio-scsi: introduce multiqueue support

Il 25/03/2013 08:25, Bart Van Assche ha scritto:
>>
>> +        queue_num = smp_processor_id();
>> +        while (unlikely(queue_num >= vscsi->num_queues))
>> +            queue_num -= vscsi->num_queues;
>> +
>> +        tgt->req_vq = vq = &vscsi->req_vqs[queue_num];
>> +    }
>> +
>> +    spin_unlock_irqrestore(&tgt->tgt_lock, flags);
>> +    return vq;
>> +}
> 
> Is there any reason why the smp_processor_id() % vscsi->num_queues
> computation in virtscsi_pick_vq() has been implemented as a loop instead
> of as an arithmetic operation ? If so, I would appreciate it if that
> could be explained in a comment.

The expectation is that vscsi->num_queues is the same as the number of
CPUs in the virtual machine; see patch 5 too.

Paolo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ