Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1280007 > unrolled thread
| Started by | Russell King - ARM Linux <linux@arm.linux.org.uk> |
|---|---|
| First post | 2015-11-30 16:40 +0100 |
| Last post | 2015-12-11 20:00 +0100 |
| Articles | 20 — 4 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [PATCH v2 1/2] scripts: Add a recorduidiv program Russell King - ARM Linux <linux@arm.linux.org.uk> - 2015-11-30 16:40 +0100
Re: [PATCH v2 1/2] scripts: Add a recorduidiv program Michal Marek <mmarek@suse.com> - 2015-11-30 16:50 +0100
Re: [PATCH v2 1/2] scripts: Add a recorduidiv program Michal Marek <mmarek@suse.cz> - 2015-12-01 17:10 +0100
Re: [PATCH v2 1/2] scripts: Add a recorduidiv program Russell King - ARM Linux <linux@arm.linux.org.uk> - 2015-12-01 17:30 +0100
Re: [PATCH v2 1/2] scripts: Add a recorduidiv program Michal Marek <mmarek@suse.cz> - 2015-12-01 17:50 +0100
Re: [PATCH v2 1/2] scripts: Add a recorduidiv program Steven Rostedt <rostedt@goodmis.org> - 2015-12-01 17:50 +0100
Re: [PATCH v2 1/2] scripts: Add a recorduidiv program Russell King - ARM Linux <linux@arm.linux.org.uk> - 2015-12-01 18:20 +0100
Re: [PATCH v2 1/2] scripts: Add a recorduidiv program Steven Rostedt <rostedt@goodmis.org> - 2015-12-01 18:30 +0100
Re: [PATCH v2 1/2] scripts: Add a recorduidiv program Russell King - ARM Linux <linux@arm.linux.org.uk> - 2015-12-01 19:20 +0100
Re: [PATCH v2 1/2] scripts: Add a recorduidiv program Michal Marek <mmarek@suse.cz> - 2015-12-01 22:40 +0100
Re: [PATCH v2 1/2] scripts: Add a recorduidiv program Russell King - ARM Linux <linux@arm.linux.org.uk> - 2015-12-02 11:30 +0100
Re: [PATCH v2 1/2] scripts: Add a recorduidiv program Steven Rostedt <rostedt@goodmis.org> - 2015-12-02 15:10 +0100
Re: [PATCH] scripts: recordmcount: break hardlinks Steven Rostedt <rostedt@goodmis.org> - 2015-12-11 15:40 +0100
Re: [PATCH] scripts: recordmcount: break hardlinks Russell King - ARM Linux <linux@arm.linux.org.uk> - 2015-12-11 15:50 +0100
Re: [PATCH] scripts: recordmcount: break hardlinks Steven Rostedt <rostedt@goodmis.org> - 2015-12-11 16:10 +0100
Re: [PATCH] scripts: recordmcount: break hardlinks Steven Rostedt <rostedt@goodmis.org> - 2015-12-11 19:20 +0100
Re: [PATCH] scripts: recordmcount: break hardlinks Russell King - ARM Linux <linux@arm.linux.org.uk> - 2015-12-11 19:40 +0100
Re: [PATCH] scripts: recordmcount: break hardlinks Russell King - ARM Linux <linux@arm.linux.org.uk> - 2015-12-11 20:00 +0100
Re: [PATCH] scripts: recordmcount: break hardlinks Steven Rostedt <rostedt@goodmis.org> - 2015-12-11 20:30 +0100
Re: [PATCH] scripts: recordmcount: break hardlinks Steven Rostedt <rostedt@goodmis.org> - 2015-12-11 20:00 +0100
| From | Russell King - ARM Linux <linux@arm.linux.org.uk> |
|---|---|
| Date | 2015-11-30 16:40 +0100 |
| Subject | Re: [PATCH v2 1/2] scripts: Add a recorduidiv program |
| Message-ID | <qAyIy-5q7-15@gated-at.bofh.it> |
On Mon, Nov 30, 2015 at 04:11:16PM +0100, Michal Marek wrote: > On 2015-11-26 00:47, Russell King - ARM Linux wrote: > > On Wed, Nov 25, 2015 at 01:51:03PM -0800, Stephen Boyd wrote: > >> The ARM compiler inserts calls to __aeabi_uidiv() and > >> __aeabi_idiv() when it needs to perform division on signed and > >> unsigned integers. If a processor has support for the udiv and > >> sdiv division instructions the calls to these support routines > >> can be replaced with those instructions. Therefore, record the > >> location of calls to these library functions into two sections > >> (one for udiv and one for sdiv) similar to how we trace calls to > >> mcount. When the kernel boots up it will check to see if the > >> processor supports the instructions and then patch the call sites > >> with the instruction. > > > > Do we have any resolution on these programs which modify the object > > files in-place, rather than breaking any hard-links which may be > > present (eg, as a result of using ccache in hard-link mode) ? > > Good point, but I do not think anybody is using CCACHE_HARDLINK with the > kernel. That's wrong then, because I've been using it for a very long time with my nightly builds. :) Therefore, there is somebody! > As the manpage says, it is going to confuse make, so the time > saved by ccache would be offset by make trying to recompile all *.c > files each time. From what I've noticed, it makes a big difference when running nightly builds. My nightly builds use O= and always build into an empty target tree, so there are no old objects back-dated to confuse make. Even if there were, make would spot that the object is older than the source, and try to re-make the target again, at which point ccache would re-hardlink the object after looking up the hashed preprocessed source. -- FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up according to speedtest.net. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | Michal Marek <mmarek@suse.com> |
|---|---|
| Date | 2015-11-30 16:50 +0100 |
| Message-ID | <qAySe-5tX-5@gated-at.bofh.it> |
| In reply to | #1280007 |
On 2015-11-30 16:32, Russell King - ARM Linux wrote: > On Mon, Nov 30, 2015 at 04:11:16PM +0100, Michal Marek wrote: >> On 2015-11-26 00:47, Russell King - ARM Linux wrote: >>> On Wed, Nov 25, 2015 at 01:51:03PM -0800, Stephen Boyd wrote: >>>> The ARM compiler inserts calls to __aeabi_uidiv() and >>>> __aeabi_idiv() when it needs to perform division on signed and >>>> unsigned integers. If a processor has support for the udiv and >>>> sdiv division instructions the calls to these support routines >>>> can be replaced with those instructions. Therefore, record the >>>> location of calls to these library functions into two sections >>>> (one for udiv and one for sdiv) similar to how we trace calls to >>>> mcount. When the kernel boots up it will check to see if the >>>> processor supports the instructions and then patch the call sites >>>> with the instruction. >>> >>> Do we have any resolution on these programs which modify the object >>> files in-place, rather than breaking any hard-links which may be >>> present (eg, as a result of using ccache in hard-link mode) ? >> >> Good point, but I do not think anybody is using CCACHE_HARDLINK with the >> kernel. > > That's wrong then, because I've been using it for a very long time with > my nightly builds. :) Therefore, there is somebody! OK. >> As the manpage says, it is going to confuse make, so the time >> saved by ccache would be offset by make trying to recompile all *.c >> files each time. > > From what I've noticed, it makes a big difference when running nightly > builds. My nightly builds use O= and always build into an empty target > tree, so there are no old objects back-dated to confuse make. > > Even if there were, make would spot that the object is older than the > source, and try to re-make the target again, at which point ccache > would re-hardlink the object after looking up the hashed preprocessed > source. That's what I meant. If you do a second make in a freshly built tree, it will recompile all the files again. It will all be cache hits, but each of the will be lot slower than comparing two timestamps. But in throwaway build trees you do not care, I haven't considered that... Michal -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Michal Marek <mmarek@suse.cz> |
|---|---|
| Date | 2015-12-01 17:10 +0100 |
| Message-ID | <qAVF7-3r6-7@gated-at.bofh.it> |
| In reply to | #1280014 |
On 2015-11-30 16:40, Michal Marek wrote: > On 2015-11-30 16:32, Russell King - ARM Linux wrote: >> On Mon, Nov 30, 2015 at 04:11:16PM +0100, Michal Marek wrote: >>> On 2015-11-26 00:47, Russell King - ARM Linux wrote: >>>> Do we have any resolution on these programs which modify the object >>>> files in-place, rather than breaking any hard-links which may be >>>> present (eg, as a result of using ccache in hard-link mode) ? >>> >>> Good point, but I do not think anybody is using CCACHE_HARDLINK with the >>> kernel. >> >> That's wrong then, because I've been using it for a very long time with >> my nightly builds. :) Therefore, there is somebody! > > OK. So, both recordmcount and the new recordudiv program are idempotent. They check if the to-be-added section is already present and do nothing. So the result is correct even with CCACHE_HARDLINK, just the intermediate file might be incorrect. If this still is considered an issue, I suggest clearing CCACHE_HARDLINK when using any of these postprocessors, so as not to penalize other use cases. The perl recordmcount does not modify the file in place. Michal -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Russell King - ARM Linux <linux@arm.linux.org.uk> |
|---|---|
| Date | 2015-12-01 17:30 +0100 |
| Message-ID | <qAVYw-3yp-45@gated-at.bofh.it> |
| In reply to | #1280988 |
On Tue, Dec 01, 2015 at 05:07:05PM +0100, Michal Marek wrote: > On 2015-11-30 16:40, Michal Marek wrote: > > On 2015-11-30 16:32, Russell King - ARM Linux wrote: > >> On Mon, Nov 30, 2015 at 04:11:16PM +0100, Michal Marek wrote: > >>> On 2015-11-26 00:47, Russell King - ARM Linux wrote: > >>>> Do we have any resolution on these programs which modify the object > >>>> files in-place, rather than breaking any hard-links which may be > >>>> present (eg, as a result of using ccache in hard-link mode) ? > >>> > >>> Good point, but I do not think anybody is using CCACHE_HARDLINK with the > >>> kernel. > >> > >> That's wrong then, because I've been using it for a very long time with > >> my nightly builds. :) Therefore, there is somebody! > > > > OK. > > So, both recordmcount and the new recordudiv program are idempotent. > They check if the to-be-added section is already present and do nothing. They hardly "do nothing", as the (eg) recordmcount plasters the build log with warnings. A solution to that would be to make recordmcount silent if the section is already present. > So the result is correct even with CCACHE_HARDLINK, just the > intermediate file might be incorrect. If this still is considered an > issue, I suggest clearing CCACHE_HARDLINK when using any of these > postprocessors, so as not to penalize other use cases. Another solution would be to have the top level make file unset the CCACHE_HARDLINK environment variable if any of the options which enable in-place editing of object files is enabled. Looking at the ccache code, the environment variable has to be deleted from the environment to turn off the option - and I'm not sure whether make can delete environment variables. It certainly can override them, but I see nothing in the info pages which suggests that environment variables can be deleted by a makefile. However, doing it outside of the kernel build system is likely error prone especially as the kernel configuration options change and/or their effect changes. -- FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up according to speedtest.net. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Michal Marek <mmarek@suse.cz> |
|---|---|
| Date | 2015-12-01 17:50 +0100 |
| Message-ID | <qAWhP-3F3-9@gated-at.bofh.it> |
| In reply to | #1281025 |
On 2015-12-01 17:19, Russell King - ARM Linux wrote: > On Tue, Dec 01, 2015 at 05:07:05PM +0100, Michal Marek wrote: >> So, both recordmcount and the new recordudiv program are idempotent. >> They check if the to-be-added section is already present and do nothing. > > They hardly "do nothing", as the (eg) recordmcount plasters the build > log with warnings. A solution to that would be to make recordmcount > silent if the section is already present. Right, there is a warning. The recorduidiv program exits silently. >> So the result is correct even with CCACHE_HARDLINK, just the >> intermediate file might be incorrect. If this still is considered an >> issue, I suggest clearing CCACHE_HARDLINK when using any of these >> postprocessors, so as not to penalize other use cases. > > Another solution would be to have the top level make file unset the > CCACHE_HARDLINK environment variable if any of the options which enable > in-place editing of object files is enabled. This is what I meant, sorry for not being clear. > Looking at the ccache > code, the environment variable has to be deleted from the environment > to turn off the option - and I'm not sure whether make can delete > environment variables. It certainly can override them, but I see > nothing in the info pages which suggests that environment variables > can be deleted by a makefile. unexport CCACHE_HARDLINK will do the trick. Michal -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Steven Rostedt <rostedt@goodmis.org> |
|---|---|
| Date | 2015-12-01 17:50 +0100 |
| Message-ID | <qAWhP-3F3-19@gated-at.bofh.it> |
| In reply to | #1281025 |
On Tue, 1 Dec 2015 16:19:44 +0000 Russell King - ARM Linux <linux@arm.linux.org.uk> wrote: > They hardly "do nothing", as the (eg) recordmcount plasters the build > log with warnings. A solution to that would be to make recordmcount > silent if the section is already present. Note, that warning found plenty of bugs when modifications of the build system was being done and broke recordmcount.c. I really don't want to silent it. But for some reason, your build is causing lots of warnings and not for others. Perhaps we can add a "SILENT_RECORDMCOUNT" environment variable and have it set when something like CCACHE_HARDLINK or whatever is causing it to trigger when we don't care. -- Steve -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Russell King - ARM Linux <linux@arm.linux.org.uk> |
|---|---|
| Date | 2015-12-01 18:20 +0100 |
| Message-ID | <qAWKS-45N-11@gated-at.bofh.it> |
| In reply to | #1281037 |
On Tue, Dec 01, 2015 at 11:49:29AM -0500, Steven Rostedt wrote:
> On Tue, 1 Dec 2015 16:19:44 +0000
> Russell King - ARM Linux <linux@arm.linux.org.uk> wrote:
>
> > They hardly "do nothing", as the (eg) recordmcount plasters the build
> > log with warnings. A solution to that would be to make recordmcount
> > silent if the section is already present.
>
> Note, that warning found plenty of bugs when modifications of the build
> system was being done and broke recordmcount.c. I really don't want to
> silent it.
>
> But for some reason, your build is causing lots of warnings and not for
> others. Perhaps we can add a "SILENT_RECORDMCOUNT" environment variable
> and have it set when something like CCACHE_HARDLINK or whatever is
> causing it to trigger when we don't care.
The case is:
Build 1 runs with CCACHE_HARDLINK enabled.
- Each object ccache creates will be stored in ccache, and hard linked
into the throw-away object tree.
- recordmcount modifies in-place the object in the object tree, which
also modifies the object in the ccache repository.
The throw-away object tree is thrown away, and a new tree is created,
and the build re-run. It doesn't matter what CCACHE options are used,
the effect will now be the same:
- Each "hit" ccache object from the previous build will be linked or
copied to the new throw-away object tree.
- recordmcount will be re-run on the object, which now contains the
results of the previous recordmcount in-place modification. This
causes recordmcount to issue a warning.
There's two solutions to this: one is to disable CCACHE_HARDLINK for
all kernel builds which use in-place object modification. The other
solution is to avoid in-place object modification, instead doing a
read-write-rename.
I think I ought to ask another question though, before we decide what
to do. With recordmcount doing in-place object modification, what
happens if a SIGINT or similar is received half way through the
modification of an object? I would hope that make would delete the
object and not leave it around.
Another suggestion - maybe recordmcount, which fstat()s the file,
should check the st_nlink before modifying the file, and error out
with a helpful error message telling people not to use hardlinks,
which would stop nasty surprises (and make it a rule that this should
be implemented as a general principle for good build behaviour) - iow,
something like this (untested):
scripts/recordmcount.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/scripts/recordmcount.c b/scripts/recordmcount.c
index 698768bdc581..bb7589fd7392 100644
--- a/scripts/recordmcount.c
+++ b/scripts/recordmcount.c
@@ -203,6 +203,10 @@ static void *mmap_file(char const *fname)
fprintf(stderr, "not a regular file: %s\n", fname);
fail_file();
}
+ if (sb.st_nlink != 1) {
+ fprintf(stderr, "file is hard linked: %s\n", fname);
+ fail_file();
+ }
addr = mmap(0, sb.st_size, PROT_READ|PROT_WRITE, MAP_PRIVATE,
fd_map, 0);
mmap_failed = 0;
--
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Steven Rostedt <rostedt@goodmis.org> |
|---|---|
| Date | 2015-12-01 18:30 +0100 |
| Message-ID | <qAWUy-49J-11@gated-at.bofh.it> |
| In reply to | #1281058 |
On Tue, 1 Dec 2015 17:10:14 +0000
Russell King - ARM Linux <linux@arm.linux.org.uk> wrote:
> Another suggestion - maybe recordmcount, which fstat()s the file,
> should check the st_nlink before modifying the file, and error out
> with a helpful error message telling people not to use hardlinks,
> which would stop nasty surprises (and make it a rule that this should
> be implemented as a general principle for good build behaviour) - iow,
Actually I like this solution the best.
> something like this (untested):
Can you test it to see if it gives you the error, otherwise I need to
set up a CCACHE_HARDLINK environment :-)
I guess another solution is to do a copy instead of modifying in place
if it detects the multiple hard link?
-- Steve
>
> scripts/recordmcount.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/scripts/recordmcount.c b/scripts/recordmcount.c
> index 698768bdc581..bb7589fd7392 100644
> --- a/scripts/recordmcount.c
> +++ b/scripts/recordmcount.c
> @@ -203,6 +203,10 @@ static void *mmap_file(char const *fname)
> fprintf(stderr, "not a regular file: %s\n", fname);
> fail_file();
> }
> + if (sb.st_nlink != 1) {
> + fprintf(stderr, "file is hard linked: %s\n", fname);
> + fail_file();
> + }
> addr = mmap(0, sb.st_size, PROT_READ|PROT_WRITE, MAP_PRIVATE,
> fd_map, 0);
> mmap_failed = 0;
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Russell King - ARM Linux <linux@arm.linux.org.uk> |
|---|---|
| Date | 2015-12-01 19:20 +0100 |
| Message-ID | <qAXGW-4Gh-1@gated-at.bofh.it> |
| In reply to | #1281070 |
On Tue, Dec 01, 2015 at 12:22:12PM -0500, Steven Rostedt wrote: > On Tue, 1 Dec 2015 17:10:14 +0000 > Russell King - ARM Linux <linux@arm.linux.org.uk> wrote: > > > Another suggestion - maybe recordmcount, which fstat()s the file, > > should check the st_nlink before modifying the file, and error out > > with a helpful error message telling people not to use hardlinks, > > which would stop nasty surprises (and make it a rule that this should > > be implemented as a general principle for good build behaviour) - iow, > > Actually I like this solution the best. > > > something like this (untested): > > Can you test it to see if it gives you the error, otherwise I need to > set up a CCACHE_HARDLINK environment :-) It does indeed: CC init/do_mounts_initrd.o file is hard linked: init/do_mounts_initrd.o /home/rmk/git/linux-rmk/scripts/Makefile.build:258: recipe for target 'init/do_mounts_initrd.o' failed make[2]: *** [init/do_mounts_initrd.o] Error 1 > I guess another solution is to do a copy instead of modifying in place > if it detects the multiple hard link? That would be the "transparent" solution. If you think it's worth persuing, I'll have a go at fixing recordmcount to do that. -- FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up according to speedtest.net. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Michal Marek <mmarek@suse.cz> |
|---|---|
| Date | 2015-12-01 22:40 +0100 |
| Message-ID | <qB0Ov-6Du-27@gated-at.bofh.it> |
| In reply to | #1281094 |
Dne 1.12.2015 v 19:16 Russell King - ARM Linux napsal(a): > On Tue, Dec 01, 2015 at 12:22:12PM -0500, Steven Rostedt wrote: >> I guess another solution is to do a copy instead of modifying in place >> if it detects the multiple hard link? > > That would be the "transparent" solution. If you think it's worth > persuing, I'll have a go at fixing recordmcount to do that. But in terms of number of file copies, it would on par with disabling CCACHE_HARDLINK from within the Makefile. Michal -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Russell King - ARM Linux <linux@arm.linux.org.uk> |
|---|---|
| Date | 2015-12-02 11:30 +0100 |
| Message-ID | <qBcPE-5Tr-37@gated-at.bofh.it> |
| In reply to | #1281094 |
On Tue, Dec 01, 2015 at 06:16:43PM +0000, Russell King - ARM Linux wrote:
> On Tue, Dec 01, 2015 at 12:22:12PM -0500, Steven Rostedt wrote:
> > I guess another solution is to do a copy instead of modifying in place
> > if it detects the multiple hard link?
>
> That would be the "transparent" solution. If you think it's worth
> persuing, I'll have a go at fixing recordmcount to do that.
Well, copying the file is easy - I've tested this and the linker
appears happy with the result:
scripts/recordmcount.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/scripts/recordmcount.c b/scripts/recordmcount.c
index 698768bdc581..91705ef30402 100644
--- a/scripts/recordmcount.c
+++ b/scripts/recordmcount.c
@@ -211,6 +211,20 @@ static void *mmap_file(char const *fname)
addr = umalloc(sb.st_size);
uread(fd_map, addr, sb.st_size);
}
+ if (sb.st_nlink != 1) {
+ /* file is hard-linked, break the hard link */
+ close(fd_map);
+ if (unlink(fname) < 0) {
+ perror(fname);
+ fail_file();
+ }
+ fd_map = open(fname, O_RDWR | O_CREAT, sb.st_mode);
+ if (fd_map < 0) {
+ perror(fname);
+ fail_file();
+ }
+ uwrite(fd_map, addr, sb.st_size);
+ }
return addr;
}
--
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Steven Rostedt <rostedt@goodmis.org> |
|---|---|
| Date | 2015-12-02 15:10 +0100 |
| Message-ID | <qBggB-8db-67@gated-at.bofh.it> |
| In reply to | #1281601 |
On Wed, 2 Dec 2015 10:23:39 +0000
Russell King - ARM Linux <linux@arm.linux.org.uk> wrote:
> On Tue, Dec 01, 2015 at 06:16:43PM +0000, Russell King - ARM Linux wrote:
> > On Tue, Dec 01, 2015 at 12:22:12PM -0500, Steven Rostedt wrote:
> > > I guess another solution is to do a copy instead of modifying in place
> > > if it detects the multiple hard link?
> >
> > That would be the "transparent" solution. If you think it's worth
> > persuing, I'll have a go at fixing recordmcount to do that.
>
> Well, copying the file is easy - I've tested this and the linker
> appears happy with the result:
Want to make this into a proper patch and I'll start running it through
my tests?
-- Steve
>
> scripts/recordmcount.c | 14 ++++++++++++++
> 1 file changed, 14 insertions(+)
>
> diff --git a/scripts/recordmcount.c b/scripts/recordmcount.c
> index 698768bdc581..91705ef30402 100644
> --- a/scripts/recordmcount.c
> +++ b/scripts/recordmcount.c
> @@ -211,6 +211,20 @@ static void *mmap_file(char const *fname)
> addr = umalloc(sb.st_size);
> uread(fd_map, addr, sb.st_size);
> }
> + if (sb.st_nlink != 1) {
> + /* file is hard-linked, break the hard link */
> + close(fd_map);
> + if (unlink(fname) < 0) {
> + perror(fname);
> + fail_file();
> + }
> + fd_map = open(fname, O_RDWR | O_CREAT, sb.st_mode);
> + if (fd_map < 0) {
> + perror(fname);
> + fail_file();
> + }
> + uwrite(fd_map, addr, sb.st_size);
> + }
> return addr;
> }
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Steven Rostedt <rostedt@goodmis.org> |
|---|---|
| Date | 2015-12-11 15:40 +0100 |
| Subject | Re: [PATCH] scripts: recordmcount: break hardlinks |
| Message-ID | <qEx1v-5JU-15@gated-at.bofh.it> |
| In reply to | #1281840 |
On Fri, 11 Dec 2015 12:09:03 +0000
Russell King <rmk+kernel@arm.linux.org.uk> wrote:
> recordmcount edits the file in-place, which can cause problems when
> using ccache in hardlink mode. Arrange for recordmcount to break a
> hardlinked object.
>
> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
> ---
> Steven, sorry it took a while to get this out...
Should this be for stable, or is it fine to just add this to my 4.5
queue?
-- Steve
>
> scripts/recordmcount.c | 14 ++++++++++++++
> 1 file changed, 14 insertions(+)
>
> diff --git a/scripts/recordmcount.c b/scripts/recordmcount.c
> index 698768bdc581..91705ef30402 100644
> --- a/scripts/recordmcount.c
> +++ b/scripts/recordmcount.c
> @@ -211,6 +211,20 @@ static void *mmap_file(char const *fname)
> addr = umalloc(sb.st_size);
> uread(fd_map, addr, sb.st_size);
> }
> + if (sb.st_nlink != 1) {
> + /* file is hard-linked, break the hard link */
> + close(fd_map);
> + if (unlink(fname) < 0) {
> + perror(fname);
> + fail_file();
> + }
> + fd_map = open(fname, O_RDWR | O_CREAT, sb.st_mode);
> + if (fd_map < 0) {
> + perror(fname);
> + fail_file();
> + }
> + uwrite(fd_map, addr, sb.st_size);
> + }
> return addr;
> }
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Russell King - ARM Linux <linux@arm.linux.org.uk> |
|---|---|
| Date | 2015-12-11 15:50 +0100 |
| Subject | Re: [PATCH] scripts: recordmcount: break hardlinks |
| Message-ID | <qExbb-5Nm-9@gated-at.bofh.it> |
| In reply to | #1289635 |
On Fri, Dec 11, 2015 at 09:31:25AM -0500, Steven Rostedt wrote: > On Fri, 11 Dec 2015 12:09:03 +0000 > Russell King <rmk+kernel@arm.linux.org.uk> wrote: > > > recordmcount edits the file in-place, which can cause problems when > > using ccache in hardlink mode. Arrange for recordmcount to break a > > hardlinked object. > > > > Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> > > --- > > Steven, sorry it took a while to get this out... > > Should this be for stable, or is it fine to just add this to my 4.5 > queue? I thought you wanted to test it first - although I've been running with this for a while now, my nightly builds have masked out the mcount warning, and I suspect it'll take a while for ccache to purge itself of the modified objects. If you're happy to add a stable tag to it, then please do so. -- RMK's Patch system: http://www.arm.linux.org.uk/developer/patches/ FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up according to speedtest.net. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Steven Rostedt <rostedt@goodmis.org> |
|---|---|
| Date | 2015-12-11 16:10 +0100 |
| Subject | Re: [PATCH] scripts: recordmcount: break hardlinks |
| Message-ID | <qExuz-69x-49@gated-at.bofh.it> |
| In reply to | #1289643 |
On Fri, 11 Dec 2015 14:45:41 +0000 Russell King - ARM Linux <linux@arm.linux.org.uk> wrote: > On Fri, Dec 11, 2015 at 09:31:25AM -0500, Steven Rostedt wrote: > > On Fri, 11 Dec 2015 12:09:03 +0000 > > Russell King <rmk+kernel@arm.linux.org.uk> wrote: > > > > > recordmcount edits the file in-place, which can cause problems when > > > using ccache in hardlink mode. Arrange for recordmcount to break a > > > hardlinked object. > > > > > > Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> > > > --- > > > Steven, sorry it took a while to get this out... > > > > Should this be for stable, or is it fine to just add this to my 4.5 > > queue? > > I thought you wanted to test it first - although I've been running with You're right. I forgot I said that ;-) > this for a while now, my nightly builds have masked out the mcount > warning, and I suspect it'll take a while for ccache to purge itself > of the modified objects. > > If you're happy to add a stable tag to it, then please do so. > I'm fine with you taking it too, but let me go ahead and run it through my tests now. I'll let you know the results. Takes several hours. Thanks, -- Steve -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Steven Rostedt <rostedt@goodmis.org> |
|---|---|
| Date | 2015-12-11 19:20 +0100 |
| Subject | Re: [PATCH] scripts: recordmcount: break hardlinks |
| Message-ID | <qEAsq-81R-11@gated-at.bofh.it> |
| In reply to | #1289643 |
On Fri, 11 Dec 2015 14:45:41 +0000 Russell King - ARM Linux <linux@arm.linux.org.uk> wrote: > On Fri, Dec 11, 2015 at 09:31:25AM -0500, Steven Rostedt wrote: > > On Fri, 11 Dec 2015 12:09:03 +0000 > > Russell King <rmk+kernel@arm.linux.org.uk> wrote: > > > > > recordmcount edits the file in-place, which can cause problems when > > > using ccache in hardlink mode. Arrange for recordmcount to break a > > > hardlinked object. > > > > > > Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> > > > --- > > > Steven, sorry it took a while to get this out... > > > > Should this be for stable, or is it fine to just add this to my 4.5 > > queue? > > I thought you wanted to test it first - although I've been running with > this for a while now, my nightly builds have masked out the mcount > warning, and I suspect it'll take a while for ccache to purge itself > of the modified objects. > > If you're happy to add a stable tag to it, then please do so. > I ran it through most my tests (it's still running and is at 20 of 33 tests). If there was anything wrong with this patch, I'm sure one of my tests would have crashed by now. Do you want to take it, or shall I? If you want to take it, you can add my: Reviewed-by: Steven Rostedt <rostedt@goodmis.org> -- Steve -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Russell King - ARM Linux <linux@arm.linux.org.uk> |
|---|---|
| Date | 2015-12-11 19:40 +0100 |
| Subject | Re: [PATCH] scripts: recordmcount: break hardlinks |
| Message-ID | <qEALM-8a5-15@gated-at.bofh.it> |
| In reply to | #1289798 |
On Fri, Dec 11, 2015 at 01:10:29PM -0500, Steven Rostedt wrote: > I ran it through most my tests (it's still running and is at 20 of 33 > tests). If there was anything wrong with this patch, I'm sure one of my > tests would have crashed by now. Thanks for testing. > Do you want to take it, or shall I? I'm easy - it probably makes more sense if take it. -- FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up according to speedtest.net. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Russell King - ARM Linux <linux@arm.linux.org.uk> |
|---|---|
| Date | 2015-12-11 20:00 +0100 |
| Subject | Re: [PATCH] scripts: recordmcount: break hardlinks |
| Message-ID | <qEB58-8gD-3@gated-at.bofh.it> |
| In reply to | #1289820 |
On Fri, Dec 11, 2015 at 01:51:15PM -0500, Steven Rostedt wrote: > On Fri, 11 Dec 2015 18:33:27 +0000 > Russell King - ARM Linux <linux@arm.linux.org.uk> wrote: > > > On Fri, Dec 11, 2015 at 01:10:29PM -0500, Steven Rostedt wrote: > > > I ran it through most my tests (it's still running and is at 20 of 33 > > > tests). If there was anything wrong with this patch, I'm sure one of my > > > tests would have crashed by now. > > > > Thanks for testing. > > > > > Do you want to take it, or shall I? > > > > I'm easy - it probably makes more sense if take it. > > > > Heh, you got me hanging in suspense. You missed a word. Is it: > > "makes more sense if *you* take it" > > or > > "makes more sense if *I* take it" > > ?? Oops, sorry. "makes more sense if *you* take it" was what I thought I typed! -- FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up according to speedtest.net. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Steven Rostedt <rostedt@goodmis.org> |
|---|---|
| Date | 2015-12-11 20:30 +0100 |
| Subject | Re: [PATCH] scripts: recordmcount: break hardlinks |
| Message-ID | <qEBya-ej-15@gated-at.bofh.it> |
| In reply to | #1289825 |
On Fri, 11 Dec 2015 18:58:09 +0000 Russell King - ARM Linux <linux@arm.linux.org.uk> wrote: > Oops, sorry. "makes more sense if *you* take it" was what I thought I > typed! > OK, will do. Thanks! -- Steve -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Steven Rostedt <rostedt@goodmis.org> |
|---|---|
| Date | 2015-12-11 20:00 +0100 |
| Subject | Re: [PATCH] scripts: recordmcount: break hardlinks |
| Message-ID | <qEB58-8gD-5@gated-at.bofh.it> |
| In reply to | #1289820 |
On Fri, 11 Dec 2015 18:33:27 +0000 Russell King - ARM Linux <linux@arm.linux.org.uk> wrote: > On Fri, Dec 11, 2015 at 01:10:29PM -0500, Steven Rostedt wrote: > > I ran it through most my tests (it's still running and is at 20 of 33 > > tests). If there was anything wrong with this patch, I'm sure one of my > > tests would have crashed by now. > > Thanks for testing. > > > Do you want to take it, or shall I? > > I'm easy - it probably makes more sense if take it. > Heh, you got me hanging in suspense. You missed a word. Is it: "makes more sense if *you* take it" or "makes more sense if *I* take it" ?? Or you could be replying to my sentence of "take it" or "shall I" in which it would be *you* take it. /me confused -- Steve -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web