* Backport dependencies helper
@ 2020-03-31 12:32 Sasha Levin
2020-03-31 13:44 ` Willy Tarreau
2020-04-03 14:24 ` Greg KH
0 siblings, 2 replies; 5+ messages in thread
From: Sasha Levin @ 2020-03-31 12:32 UTC (permalink / raw)
To: linux-kernel, stable
Hi all,
I wanted to share a resource I've been using to help me with doing
backports to various stable kernels.
In the Stable Kernel world, when we need to backport a patch, we'd
rather take any relevant dependencies to make the patch work cleanly on
an older kernel, rather than modifying the patch and diverging from
upstream.
This raises an interesting problem: how do we figure out which other
patches might be "interesting" to look at? git-blame is a great tool,
but it takes a while to go through the history of a patch, and given the
volume of patches we need to look at, it just isn't enough.
So here's a tool in the form of a git repo that can help point out these
interesting patches:
https://git.kernel.org/pub/scm/linux/kernel/git/sashal/deps.git/
How does it work, you might ask? It's actually quite simple: Each
directory represents a kernel version which we'll call K, and each file
inside that directory is named after an upstream commit we'll call C,
and it's content are the list of commits one would need to apply on top
of kernel K to "reach" commit C.
For example, let's say we want to apply:
f8788d86ab28 ("Linux 5.6-rc3")
On top of the v5.5 kernel tree. All we need to do is:
$ cat v5.5/f8788d86ab28f61f7b46eb6be375f8a726783636
f8788d86ab28 ("Linux 5.6-rc3")
11a48a5a18c6 ("Linux 5.6-rc2")
bb6d3fb354c5 ("Linux 5.6-rc1")
If you don't feel like cloning the repo (which contains quite a few
files), you can also use kernel.org's web interface in a script that
might look something like this:
#!/bin/bash
curl https://git.kernel.org/pub/scm/linux/kernel/git/sashal/deps.git/plain/$1/$2
And then simply:
$ ./deps.sh v5.5 f8788d86ab28f61f7b46eb6be375f8a726783636
f8788d86ab28 ("Linux 5.6-rc3")
11a48a5a18c6 ("Linux 5.6-rc2")
bb6d3fb354c5 ("Linux 5.6-rc1")
Caveats:
- Each file is limited to 50 entries. I feel that at that point it
stops being useful.
- Each file stops if a merge commit is hit.
- I might have bugs in my scripts and some entries are broken, please
report those if you see them.
--
Thanks,
Sasha
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Backport dependencies helper
2020-03-31 12:32 Backport dependencies helper Sasha Levin
@ 2020-03-31 13:44 ` Willy Tarreau
2020-03-31 14:08 ` Sasha Levin
2020-04-03 14:24 ` Greg KH
1 sibling, 1 reply; 5+ messages in thread
From: Willy Tarreau @ 2020-03-31 13:44 UTC (permalink / raw)
To: Sasha Levin; +Cc: linux-kernel, stable
Hi Sasha,
On Tue, Mar 31, 2020 at 08:32:17AM -0400, Sasha Levin wrote:
> Each
> directory represents a kernel version which we'll call K, and each file
> inside that directory is named after an upstream commit we'll call C,
> and it's content are the list of commits one would need to apply on top
> of kernel K to "reach" commit C.
That's very interesting! I still have nightmare-like memories or
complete week-ends spent trying to address this using heuristics
when I was maintaining 2.6.32 and 3.10. However how do you produce
these ? Is this related to the stable-deps utility in your stable-tools
repository ?
Thanks,
Willy
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Backport dependencies helper
2020-03-31 13:44 ` Willy Tarreau
@ 2020-03-31 14:08 ` Sasha Levin
2020-03-31 14:41 ` Willy Tarreau
0 siblings, 1 reply; 5+ messages in thread
From: Sasha Levin @ 2020-03-31 14:08 UTC (permalink / raw)
To: Willy Tarreau; +Cc: linux-kernel, stable
On Tue, Mar 31, 2020 at 03:44:00PM +0200, Willy Tarreau wrote:
>Hi Sasha,
>
>On Tue, Mar 31, 2020 at 08:32:17AM -0400, Sasha Levin wrote:
>> Each
>> directory represents a kernel version which we'll call K, and each file
>> inside that directory is named after an upstream commit we'll call C,
>> and it's content are the list of commits one would need to apply on top
>> of kernel K to "reach" commit C.
>
>That's very interesting! I still have nightmare-like memories or
>complete week-ends spent trying to address this using heuristics
>when I was maintaining 2.6.32 and 3.10. However how do you produce
>these ? Is this related to the stable-deps utility in your stable-tools
>repository ?
No, those tools try to do the same thing, but work differently.
stable-deps attempts to look at context lines surrounding the patch
itself to guess which other patches might be interesting.
While here, I use git-bisect to create a list of commits required to be
applied before any given commit.
--
Thanks,
Sasha
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Backport dependencies helper
2020-03-31 14:08 ` Sasha Levin
@ 2020-03-31 14:41 ` Willy Tarreau
0 siblings, 0 replies; 5+ messages in thread
From: Willy Tarreau @ 2020-03-31 14:41 UTC (permalink / raw)
To: Sasha Levin; +Cc: linux-kernel, stable
On Tue, Mar 31, 2020 at 10:08:30AM -0400, Sasha Levin wrote:
> No, those tools try to do the same thing, but work differently.
> stable-deps attempts to look at context lines surrounding the patch
> itself to guess which other patches might be interesting.
OK!
> While here, I use git-bisect to create a list of commits required to be
> applied before any given commit.
I see, this sounds like a great idea!
Thanks,
Willy
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Backport dependencies helper
2020-03-31 12:32 Backport dependencies helper Sasha Levin
2020-03-31 13:44 ` Willy Tarreau
@ 2020-04-03 14:24 ` Greg KH
1 sibling, 0 replies; 5+ messages in thread
From: Greg KH @ 2020-04-03 14:24 UTC (permalink / raw)
To: Sasha Levin; +Cc: linux-kernel, stable
On Tue, Mar 31, 2020 at 08:32:17AM -0400, Sasha Levin wrote:
> Hi all,
>
> I wanted to share a resource I've been using to help me with doing
> backports to various stable kernels.
>
> In the Stable Kernel world, when we need to backport a patch, we'd
> rather take any relevant dependencies to make the patch work cleanly on
> an older kernel, rather than modifying the patch and diverging from
> upstream.
>
> This raises an interesting problem: how do we figure out which other
> patches might be "interesting" to look at? git-blame is a great tool,
> but it takes a while to go through the history of a patch, and given the
> volume of patches we need to look at, it just isn't enough.
>
> So here's a tool in the form of a git repo that can help point out these
> interesting patches:
>
> https://git.kernel.org/pub/scm/linux/kernel/git/sashal/deps.git/
>
> How does it work, you might ask? It's actually quite simple: Each
> directory represents a kernel version which we'll call K, and each file
> inside that directory is named after an upstream commit we'll call C,
> and it's content are the list of commits one would need to apply on top
> of kernel K to "reach" commit C.
>
> For example, let's say we want to apply:
>
> f8788d86ab28 ("Linux 5.6-rc3")
>
> On top of the v5.5 kernel tree. All we need to do is:
>
> $ cat v5.5/f8788d86ab28f61f7b46eb6be375f8a726783636
> f8788d86ab28 ("Linux 5.6-rc3")
> 11a48a5a18c6 ("Linux 5.6-rc2")
> bb6d3fb354c5 ("Linux 5.6-rc1")
>
> If you don't feel like cloning the repo (which contains quite a few
> files), you can also use kernel.org's web interface in a script that
> might look something like this:
>
> #!/bin/bash
> curl https://git.kernel.org/pub/scm/linux/kernel/git/sashal/deps.git/plain/$1/$2
>
> And then simply:
>
> $ ./deps.sh v5.5 f8788d86ab28f61f7b46eb6be375f8a726783636
> f8788d86ab28 ("Linux 5.6-rc3")
> 11a48a5a18c6 ("Linux 5.6-rc2")
> bb6d3fb354c5 ("Linux 5.6-rc1")
>
> Caveats:
>
> - Each file is limited to 50 entries. I feel that at that point it
> stops being useful.
> - Each file stops if a merge commit is hit.
> - I might have bugs in my scripts and some entries are broken, please
> report those if you see them.
This is really cool, thanks for posting this, and for doing this work.
greg k-h
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-04-03 14:25 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-31 12:32 Backport dependencies helper Sasha Levin
2020-03-31 13:44 ` Willy Tarreau
2020-03-31 14:08 ` Sasha Levin
2020-03-31 14:41 ` Willy Tarreau
2020-04-03 14:24 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).