* [gentoo-portage-dev] Re: proj/portage:master commit in: man/, pym/portage/dbapi/, pym/portage/, cnf/
[not found] <1351154722.10b6d0129d062f4d5d8a7611023c3f8cc43f1eab.zmedico@gentoo>
@ 2012-10-25 9:34 ` Fabian Groffen
2012-10-25 9:45 ` Zac Medico
0 siblings, 1 reply; 4+ messages in thread
From: Fabian Groffen @ 2012-10-25 9:34 UTC (permalink / raw
To: gentoo-portage-dev
[-- Attachment #1: Type: text/plain, Size: 807 bytes --]
On 25-10-2012 08:45:36 +0000, Zac Medico wrote:
> URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=10b6d012
>
> Add FEATURES=merge-sync, for bug #439584.
> + if not self._device_path_map or \
> + "merge-sync" not in self.settings.features:
> + return
> +
> + syncfs = self._get_syncfs()
> + if syncfs is None:
> + try:
> + proc = subprocess.Popen(["sync"])
> + except EnvironmentError:
> + pass
> + else:
> + proc.wait()
> + else:
> + for path in self._device_path_map.values():
> + try:
> + fd = os.open(path, os.O_RDONLY)
> + except OSError:
> + pass
> + else:
> + try:
> + syncfs(fd)
can't you use os.fdatasync() or os.fsync() instead?
--
Fabian Groffen
Gentoo on a different level
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [gentoo-portage-dev] Re: proj/portage:master commit in: man/, pym/portage/dbapi/, pym/portage/, cnf/
2012-10-25 9:34 ` [gentoo-portage-dev] Re: proj/portage:master commit in: man/, pym/portage/dbapi/, pym/portage/, cnf/ Fabian Groffen
@ 2012-10-25 9:45 ` Zac Medico
2012-10-25 12:32 ` Fabian Groffen
0 siblings, 1 reply; 4+ messages in thread
From: Zac Medico @ 2012-10-25 9:45 UTC (permalink / raw
To: gentoo-portage-dev
On 10/25/2012 02:34 AM, Fabian Groffen wrote:
> On 25-10-2012 08:45:36 +0000, Zac Medico wrote:
>> URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=10b6d012
>>
>> Add FEATURES=merge-sync, for bug #439584.
>
>> + if not self._device_path_map or \
>> + "merge-sync" not in self.settings.features:
>> + return
>> +
>> + syncfs = self._get_syncfs()
>> + if syncfs is None:
>> + try:
>> + proc = subprocess.Popen(["sync"])
>> + except EnvironmentError:
>> + pass
>> + else:
>> + proc.wait()
>> + else:
>> + for path in self._device_path_map.values():
>> + try:
>> + fd = os.open(path, os.O_RDONLY)
>> + except OSError:
>> + pass
>> + else:
>> + try:
>> + syncfs(fd)
>
> can't you use os.fdatasync() or os.fsync() instead?
os.fdatasync() or os.fsync() only work for single files, right? We don't
want to sync them individually, since that wastes disk bandwidth. It's
much more efficient to sync the whole filesystem at once, like syncfs does.
--
Thanks,
Zac
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [gentoo-portage-dev] Re: proj/portage:master commit in: man/, pym/portage/dbapi/, pym/portage/, cnf/
2012-10-25 9:45 ` Zac Medico
@ 2012-10-25 12:32 ` Fabian Groffen
2012-10-25 15:01 ` Zac Medico
0 siblings, 1 reply; 4+ messages in thread
From: Fabian Groffen @ 2012-10-25 12:32 UTC (permalink / raw
To: gentoo-portage-dev
[-- Attachment #1: Type: text/plain, Size: 494 bytes --]
On 25-10-2012 02:45:41 -0700, Zac Medico wrote:
> > can't you use os.fdatasync() or os.fsync() instead?
>
> os.fdatasync() or os.fsync() only work for single files, right? We don't
> want to sync them individually, since that wastes disk bandwidth. It's
> much more efficient to sync the whole filesystem at once, like syncfs does.
You use syncfs, which according to the man-page requires a
filedescriptor. Hence my suggestion.
--
Fabian Groffen
Gentoo on a different level
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [gentoo-portage-dev] Re: proj/portage:master commit in: man/, pym/portage/dbapi/, pym/portage/, cnf/
2012-10-25 12:32 ` Fabian Groffen
@ 2012-10-25 15:01 ` Zac Medico
0 siblings, 0 replies; 4+ messages in thread
From: Zac Medico @ 2012-10-25 15:01 UTC (permalink / raw
To: gentoo-portage-dev
On 10/25/2012 05:32 AM, Fabian Groffen wrote:
> On 25-10-2012 02:45:41 -0700, Zac Medico wrote:
>>> can't you use os.fdatasync() or os.fsync() instead?
>>
>> os.fdatasync() or os.fsync() only work for single files, right? We don't
>> want to sync them individually, since that wastes disk bandwidth. It's
>> much more efficient to sync the whole filesystem at once, like syncfs does.
>
> You use syncfs, which according to the man-page requires a
> filedescriptor. Hence my suggestion.
Yeah, that's just an artifact of the syncfs api. Apparently the kernel
just needs that to map the call back to the relevant filesystem.
--
Thanks,
Zac
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-10-25 15:10 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1351154722.10b6d0129d062f4d5d8a7611023c3f8cc43f1eab.zmedico@gentoo>
2012-10-25 9:34 ` [gentoo-portage-dev] Re: proj/portage:master commit in: man/, pym/portage/dbapi/, pym/portage/, cnf/ Fabian Groffen
2012-10-25 9:45 ` Zac Medico
2012-10-25 12:32 ` Fabian Groffen
2012-10-25 15:01 ` Zac Medico
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox