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 for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Sun, 21 May 2023 21:21:36 +0800
From:   Coly Li <colyli@...e.de>
To:     linux-tip-commits@...r.kernel.org
Cc:     Kent Overstreet <kent.overstreet@...ux.dev>,
        "Peter Zijlstra (Intel)" <peterz@...radead.org>,
        LKML <linux-kernel@...r.kernel.org>,
        "Coly Li <colyli@...e.de>" <"mailto:colyli"@suse.de>,
        x86@...nel.org
Subject: Re: [tip: locking/core] bcache: Convert to lock_cmp_fn



> 2023年5月20日 18:49,tip-bot2 for Kent Overstreet <tip-bot2@...utronix.de> 写道:
> 
> The following commit has been merged into the locking/core branch of tip:
> 
> Commit-ID:     0ad397b556936a14052aa65d8fa958a9f3175add
> Gitweb:        https://git.kernel.org/tip/0ad397b556936a14052aa65d8fa958a9f3175add
> Author:        Kent Overstreet <kent.overstreet@...ux.dev>
> AuthorDate:    Tue, 09 May 2023 15:58:47 -04:00
> Committer:     Peter Zijlstra <peterz@...radead.org>
> CommitterDate: Fri, 19 May 2023 12:35:10 +02:00
> 
> bcache: Convert to lock_cmp_fn
> 
> Replace one of bcache's lockdep_set_novalidate_class() usage with the
> newly introduced custom lock nesting annotation.
> 
> [peterz: changelog]
> Signed-off-by: Kent Overstreet <kent.overstreet@...ux.dev>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
> Acked-by: Coly Li <colyli@...e.de <mailto:colyli@...e.de>>


Can the above “<mailto:colyli@...e.de>” be removed from my acked-by. This was automatically and invisibly added by MacOS email client, which just introduced chaos in such use case.

Thanks.

Coly Li


> Link: https://lkml.kernel.org/r/20230509195847.1745548-2-kent.overstreet@linux.dev
> ---
> drivers/md/bcache/btree.c | 23 ++++++++++++++++++++++-
> drivers/md/bcache/btree.h |  4 ++--
> 2 files changed, 24 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/md/bcache/btree.c b/drivers/md/bcache/btree.c
> index 147c493..569f489 100644
> --- a/drivers/md/bcache/btree.c
> +++ b/drivers/md/bcache/btree.c
> @@ -559,6 +559,27 @@ static void mca_data_alloc(struct btree *b, struct bkey *k, gfp_t gfp)
> }
> }
> 
> +#define cmp_int(l, r) ((l > r) - (l < r))
> +
> +#ifdef CONFIG_PROVE_LOCKING
> +static int btree_lock_cmp_fn(const struct lockdep_map *_a,
> +     const struct lockdep_map *_b)
> +{
> + const struct btree *a = container_of(_a, struct btree, lock.dep_map);
> + const struct btree *b = container_of(_b, struct btree, lock.dep_map);
> +
> + return -cmp_int(a->level, b->level) ?: bkey_cmp(&a->key, &b->key);
> +}
> +
> +static void btree_lock_print_fn(const struct lockdep_map *map)
> +{
> + const struct btree *b = container_of(map, struct btree, lock.dep_map);
> +
> + printk(KERN_CONT " l=%u %llu:%llu", b->level,
> +       KEY_INODE(&b->key), KEY_OFFSET(&b->key));
> +}
> +#endif
> +
> static struct btree *mca_bucket_alloc(struct cache_set *c,
>      struct bkey *k, gfp_t gfp)
> {
> @@ -572,7 +593,7 @@ static struct btree *mca_bucket_alloc(struct cache_set *c,
> return NULL;
> 
> init_rwsem(&b->lock);
> - lockdep_set_novalidate_class(&b->lock);
> + lock_set_cmp_fn(&b->lock, btree_lock_cmp_fn, btree_lock_print_fn);
> mutex_init(&b->write_lock);
> lockdep_set_novalidate_class(&b->write_lock);
> INIT_LIST_HEAD(&b->list);
> diff --git a/drivers/md/bcache/btree.h b/drivers/md/bcache/btree.h
> index 1b5fdbc..17b1d20 100644
> --- a/drivers/md/bcache/btree.h
> +++ b/drivers/md/bcache/btree.h
> @@ -247,8 +247,8 @@ static inline void bch_btree_op_init(struct btree_op *op, int write_lock_level)
> 
> static inline void rw_lock(bool w, struct btree *b, int level)
> {
> - w ? down_write_nested(&b->lock, level + 1)
> -  : down_read_nested(&b->lock, level + 1);
> + w ? down_write(&b->lock)
> +  : down_read(&b->lock);
> if (w)
> b->seq++;
> }

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ