Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1628000
| Path | csiph.com!news.redatomik.org!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | Laurent Dufour <ldufour@linux.vnet.ibm.com> |
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 2/6] locking: Introduce range reader/writer lock |
| Date | Fri, 21 Apr 2017 09:10:02 +0200 |
| Message-ID | <tyARA-2SW-17@gated-at.bofh.it> (permalink) |
| References | <ttbh9-6aP-61@gated-at.bofh.it> <ttbqO-6ei-37@gated-at.bofh.it> <txBPH-6OW-5@gated-at.bofh.it> <tymOD-2ES-33@gated-at.bofh.it> |
| X-Original-To | Davidlohr Bueso <dave@stgolabs.net> |
| User-Agent | Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset=windows-1252 |
| Content-Transfer-Encoding | 7bit |
| X-Tm-As-Gconf | 00 |
| X-Cbid | 17042107-0020-0000-0000-0000034CE405 |
| X-Ibm-Av-Detection | SAVI=unused REMOTE=unused XFE=unused |
| X-Cbparentid | 17042107-0021-0000-0000-0000415F347E |
| X-Proofpoint-Virus-Version | vendor=fsecure engine=2.50.10432:,, definitions=2017-04-21_06:,, signatures=0 |
| X-Proofpoint-Spam-Details | rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1703280000 definitions=main-1704210129 |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 36 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | mingo@kernel.org, peterz@infradead.org, akpm@linux-foundation.org, jack@suse.cz, kirill.shutemov@linux.intel.com, mhocko@suse.com, mgorman@techsingularity.net, linux-kernel@vger.kernel.org, Davidlohr Bueso <dbueso@suse.de> |
| X-Original-Date | Fri, 21 Apr 2017 09:00:41 +0200 |
| X-Original-Message-ID | <d6378a2f-acf2-6771-970f-b0fbf2d3a120@linux.vnet.ibm.com> |
| X-Original-References | <20170406084620.22700-1-dave@stgolabs.net> <20170406084620.22700-3-dave@stgolabs.net> <b1a53492-7fb3-a3cd-80d1-92dc4be5d8c4@linux.vnet.ibm.com> <20170420155125.GA20746@linux-80c1.suse> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1628000 |
Show key headers only | View raw
On 20/04/2017 18:01, Davidlohr Bueso wrote:
>>> +int range_read_trylock(struct range_rwlock_tree *tree, struct
>>> range_rwlock *lock)
>>> +{
>>> + int ret = true;
>>> + unsigned long flags;
>>> + struct interval_tree_node *node;
>>> +
>>> + spin_lock_irqsave(&tree->lock, flags);
>>> +
>>> + if (!__range_intersects_intree(tree, lock))
>>> + goto insert;
>>> +
>>> + /*
>>> + * We have overlapping ranges in the tree, ensure that we can
>>> + * in fact share the lock.
>>> + */
>>> + range_interval_tree_foreach(node, &tree->root,
>>> + lock->node.start, lock->node.last) {
>>> + struct range_rwlock *blocked_lock;
>>> + blocked_lock = range_entry(node, struct range_rwlock, node);
>>> +
>>> + if (!range_lock_is_reader(blocked_lock)) {
>>> + ret = false;
>>> + goto unlock;
>>> + }
>>> + }
>>> +insert:
>>> + range_lock_set_reader(lock);
>>
>> Here, the lock->waiter field should have been set to current before
>> calling range_lock_set_reader()
>
> But this is a trylock attempt, there is no waiting going on.
Agreed, this one is useless.
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
Re: [PATCH 2/6] locking: Introduce range reader/writer lock Laurent Dufour <ldufour@linux.vnet.ibm.com> - 2017-04-18 16:00 +0200
Re: [PATCH 2/6] locking: Introduce range reader/writer lock Davidlohr Bueso <dave@stgolabs.net> - 2017-04-20 18:10 +0200
Re: [PATCH 2/6] locking: Introduce range reader/writer lock Laurent Dufour <ldufour@linux.vnet.ibm.com> - 2017-04-21 09:10 +0200
csiph-web