From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Kent Overstreet <kent.overstreet@linux.dev>,
Andrew Morton <akpm@linux-foundation.org>
Cc: Kuan-Wei Chiu <visitorckw@gmail.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Linux Next Mailing List <linux-next@vger.kernel.org>
Subject: linux-next: manual merge of the bcachefs tree with the mm-nonmm-stable tree
Date: Fri, 12 Jul 2024 10:57:11 +1000 [thread overview]
Message-ID: <20240712105711.6dc900a2@canb.auug.org.au> (raw)
[-- Attachment #1: Type: text/plain, Size: 4049 bytes --]
Hi all,
Today's linux-next merge of the bcachefs tree got a conflict in:
fs/bcachefs/clock.c
between commit:
1fcce6b8a768 ("bcachefs: remove heap-related macros and switch to generic min_heap")
from the mm-nonmm-stable tree and commit:
54fb2dad4aae ("bcachefs: Convert clock code to u64s")
from the bcachefs tree.
I fixed it up (I think - see below) and can carry the fix as necessary.
This is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging. You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.
--
Cheers,
Stephen Rothwell
diff --cc fs/bcachefs/clock.c
index b50d7cd6fbde,df3763c18c0e..000000000000
--- a/fs/bcachefs/clock.c
+++ b/fs/bcachefs/clock.c
@@@ -24,22 -15,15 +24,20 @@@ static inline void io_timer_swp(void *l
void bch2_io_timer_add(struct io_clock *clock, struct io_timer *timer)
{
- size_t i;
+ const struct min_heap_callbacks callbacks = {
+ .less = io_timer_cmp,
+ .swp = io_timer_swp,
+ };
+
spin_lock(&clock->timer_lock);
- if (time_after_eq((unsigned long) atomic64_read(&clock->now),
- timer->expire)) {
+ if (time_after_eq64((u64) atomic64_read(&clock->now), timer->expire)) {
spin_unlock(&clock->timer_lock);
timer->fn(timer);
return;
}
- for (i = 0; i < clock->timers.nr; i++)
- for (size_t i = 0; i < clock->timers.used; i++)
++ for (int i = 0; i < clock->timers.nr; i++)
if (clock->timers.data[i] == timer)
goto out;
@@@ -50,17 -34,11 +48,16 @@@ out
void bch2_io_timer_del(struct io_clock *clock, struct io_timer *timer)
{
- size_t i;
+ const struct min_heap_callbacks callbacks = {
+ .less = io_timer_cmp,
+ .swp = io_timer_swp,
+ };
+
spin_lock(&clock->timer_lock);
- for (i = 0; i < clock->timers.nr; i++)
- for (size_t i = 0; i < clock->timers.used; i++)
++ for (int i = 0; i < clock->timers.nr; i++)
if (clock->timers.data[i] == timer) {
- heap_del(&clock->timers, i, io_timer_cmp, NULL);
+ min_heap_del(&clock->timers, i, &callbacks, NULL);
break;
}
@@@ -144,21 -120,13 +139,20 @@@ void bch2_kthread_io_clock_wait(struct
bch2_io_timer_del(clock, &wait.io_timer);
}
- static struct io_timer *get_expired_timer(struct io_clock *clock,
- unsigned long now)
+ static struct io_timer *get_expired_timer(struct io_clock *clock, u64 now)
{
struct io_timer *ret = NULL;
+ const struct min_heap_callbacks callbacks = {
+ .less = io_timer_cmp,
+ .swp = io_timer_swp,
+ };
+
+ if (clock->timers.nr &&
- time_after_eq(now, clock->timers.data[0]->expire)) {
++ time_after_eq64(now, clock->timers.data[0]->expire)) {
+ ret = *min_heap_peek(&clock->timers);
+ min_heap_pop(&clock->timers, &callbacks, NULL);
+ }
- if (clock->timers.used &&
- time_after_eq64(now, clock->timers.data[0]->expire))
- heap_pop(&clock->timers, ret, io_timer_cmp, NULL);
return ret;
}
@@@ -175,17 -143,18 +169,18 @@@ void __bch2_increment_clock(struct io_c
void bch2_io_timers_to_text(struct printbuf *out, struct io_clock *clock)
{
- unsigned long now;
- unsigned i;
-
out->atomic++;
spin_lock(&clock->timer_lock);
- now = atomic64_read(&clock->now);
+ u64 now = atomic64_read(&clock->now);
- for (i = 0; i < clock->timers.nr; i++)
- prt_printf(out, "%ps:\t%li\n",
+ printbuf_tabstop_push(out, 40);
+ prt_printf(out, "current time:\t%llu\n", now);
+
- for (unsigned i = 0; i < clock->timers.used; i++)
++ for (int i = 0; i < clock->timers.nr; i++)
+ prt_printf(out, "%ps %ps:\t%llu\n",
clock->timers.data[i]->fn,
- clock->timers.data[i]->expire - now);
+ clock->timers.data[i]->fn2,
+ clock->timers.data[i]->expire);
spin_unlock(&clock->timer_lock);
--out->atomic;
}
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
reply other threads:[~2024-07-12 0:57 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240712105711.6dc900a2@canb.auug.org.au \
--to=sfr@canb.auug.org.au \
--cc=akpm@linux-foundation.org \
--cc=kent.overstreet@linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
--cc=visitorckw@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®