-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi Lund,
hi All,
thanks for the detailed answer. Before I answer back in-line below,
I'd like to share a few general observations and comments.
It is obvious to me, that we (Lund and Björn) have very different
views on a few crucial things. Which is fine for me, as long as we
are aware of it and can agree to disagree.
The most obvious one is the question of development style. Pushed to
extremes, there are to schools: (a) Develop with the compiler running,
i.e. "code, compile, tweak" in a loop, until it compiles, then tweak
until it does the job. Don't care about design or internal structure.
And (b) design on paper, develop on paper, debug (i.e. review) on
paper. When done, once compile the code and repeat all the tests done
on paper with the real thing - no surprise should show up.
In their extreme, both approaches are impractical, but I am clearly
positioned far towards (b), and I assume you are somewhere towards (a).
Maybe at the 1/4 milestone on the path from (a) to (b)?
I am probably somewhere between the 2/3 and 7/8 milestones.
The second point are intellectual property rights. While I am
convinced, that the current IPR regulations in Europe and elsewhere
badly need an upgrade to move from the late 19th to the early 21st
century, I'll enforce them wherever I can.
Am 24.06.13 03:10, schrieb
lun...@lundman.net:
> My motivation stems from that I want ZFS for All Platforms, at any
> cost. So I would have been just fine running ZEVO, if it wasn't for
> the fact that it is missing features I consider crucial.
Out of curiosity: Which features?
> I would be happy with a stolen copy made my Chinese Sweatshops!
A statement your are free to make as an independent individual. But a
hazardous opinion to voice for any (public) project.
> And I did look at MacZFS, but alas at version=8, is missing even
> more features than ZEVO, and not really easy to port forward.
>
> So I was forced to make my own attempt.
See below at (1).
> Even though I joke about it, I will explore how a VFS layer could
> be done on Windows after this.
Seriously? If you really manage a working port of ZFS to a recent
Windows, it would probably mean eternal fame -- and a whole new
storage experience for millions of users!
> With that in mind, let me fire my volley in this discussion!
>
>> On the other side, hacking up ("hacking" in its positive sense!)
>> a running code is one thing, long-term maintainability and
>> responsible release policy is another thing. Especially in
>> Kernel space and even more in file systems, where people store
>> their invaluable data, way to often without a backup strategy.
>>
>>
> This was definitely a hack, and a one-off. Consider it an
> experiment. I wanted to see if "compiling" was putting OS X users
> off testing it, or convenience, or what. So as an attempt to get a
> poll of possible users, and possible 'news buzz' generated, it
> resulted in exactly 2 download, and 3 upvotes. I don't think of it
> as something negative, it just means I should expect to do most,
> if not all, myself. But I was expecting that from the start. Any
> help is a pleasant surprise.
I am not sure if your comment just targets the "testing situation", or
includes the development before. Assuming the latter, I'd loved to
help and contribute, but by just pushing forward, without much
discussion on how you envision the port, how to deal with various
design choices to take on the way, you made helping pretty hard.
(1)
Silently looking around and then starting one's own thing without
making much words is certainly a possible way to attack the unsure
future of ZEVO and the really slow progress of MacZFS. -- Often seen
in the Open Source world and so far a successful one.
(About development approach, see also (2) and (3) below.)
>> I tried to keep up with your commits and review code changes as
>> they happen, but you proved yourself to be to productive. :-)
>>
> I find it a little odd that you would attempt it. You will be
> spending all day reading other people's work, rather than
> contributing yourself.
To contribute something that fits, I first need to understand what you
are doing, and which design you are following.
> Once we have a stable platform, and maintaining stability is
> primary, I can understand.
:-) Sorry, but I had to smile here. I have heard variations of that
line probably a thousand times from my students. And as many times I
answered back: No, stability and security has to be designed in from
the beginning. You can't bolt it on later.
> Still, I'm not complaining, if you want to do that, then do that.
> :)
< off-topic >
First design, then code and constant peer review is just my second
nature. In my professional life, among other things I teach software
development for autonomous robots. Our machines directly interact
with people, without fences or other physical protection, so safety is
a primary concern. In that life, not a single line of code should
ever end up on the machines without being peer reviewed and clean,
readable code with documented design is a must.
Of course, ZFS for Mac is a different being, but at the same time I
can't teach one style while in class and apply the opposite style on
my (public) spare time projects.
< /off-topic >
>> - The current handling of pipes is an ugly hack. In my opinion,
>> it is not maintainable across releases.
>>
>>
> On this we will most likely always disagree. ZFS send/recv with
> pipe support is a must, and the command line juggle suggested, to
> work around the lack of pipes, really needs to be cleansed with
> fire. I personally feel the mistake is actually that of Apple's.
> Happily providing API calls for files, and Network streams, but
> forgetting pipes.
>
> At the moment, this works from 10.6 to 10.9. It is possible that
> 10.10 will break, and if so, another solution will be needed.
> Which goes pretty much for every single call to the kernel. ZEVO
> also calls the same function, and even though ZEVO version does not
> work on Mavericks, it is not related to this. Although, they
> clearly found some other way to link than using Evan's special
> KEXT.
>
> Now, if you wish to make a PEDANTIC preprocessor macro, to compile
> the kext without the 2 calls, that would be acceptable. This way
> you can ensure your version is pristine.
Nothing to add here. We disagree.
>> - The current approach to solve the "mutex_enter: locking
>> against myself" panics. I am not convinced this isn't allowing
>> race conditions.
>>
>>
> One of the differences in getting a new vnode on the BSD
> platforms, is that calling vnode_create() can start a reclaim
> process. FreeBSD's solutions to this is to pre-allocate the vnode
> before entering the lock. This solution does not work on OS X.
> Apple was a little lean with the vnode API here.
Agreed on Apple being a bit lean with the vnode API.
> Now, as the reclaim process is always (currently) run as the
> current-thread, we can handle it pretty cleanly by checking for
> lock ownership. If Apple ever changes it to a separate reclaim
> thread, we will definitely need a different solution.
>
> ZEVO's approach is to not-reclaim-znodes during this time (by
> checking ownership), but throw them on a reclaim list. Spawn a
> reclaim thread to release them 'later'. If you inspect the error
> messages of ZEVO (and the forum panics) they also have issues of
> the reclaim thread being full etc. Not convinced that this is a
> better solution.
I do not have a definite idea either. With pre-allocation unavailable,
it is a hard problem. Especially as we are not allowed to reject a
reclaim call (the Darwin API documentation says, that return with an
error from vnop_reclaim will panic).
Something I'd like to explore is to move the real vnode interaction
entirely out of the lock protected ZFS core. Do everything only on
znodes, and if that succeeded, then in a second step update the VFS'
view, rolling back the znode side if the VFS update fails. Of course,
this would probably require yet another level of locking outside the
existing layers, and will also be hard to get race-free.
:-) Once more the "principle of the preservation of the hard work" at
work: No matter what you try to ease a job, at some point you have to
do the heavy lifting.
>> - Apparent incompatibility with ZEVO, which may (or may not)
>> indicate inconsistencies in the on-disk format (may be ZEVOs
>> fault, needs to be checked).
>>
>>
> Already fixed, you are about 4 days behind. It was missing XATTR,
> and getdirattr calls. More in this below.
You are /really/ fast.
>>
>> - The current code is a wild mixture of at least three code
>> lines, bolted together on a "what runs, that runs" base. Fine
>> for understanding the challenges and quickly producing a test
>> version.
>>
>>
> In a sense. My first "phase" was to get something to work, as
> quickly as possible. This was to tell me, if *I* could do this at
> all. Naturally, you don't want to spend too long on something that
> you might not be capable of doing.
>
> After some weeks, it became clear that I could probably do it.
>
> At this point, Will's had done his much cleaner VNOP wrapper
> layer. I ditched the hastily throw together work, and started
> again.
>
> I took "the 5" interface source files (zfs_vfsops, zfs_znode,
> zfs_dir, zfs_acl, zfs_fuid) directly from FreeBSD. I made sure to
> not put any MacZFS work into it, then ported everything again into
> zfs_vnop_osx and zfs_vnop_osx_lib as was started by Will.
>
> One of the worst ideas of the original MacZFS is the z_phys nodes
> inside the z_node, as some sort of "persistent" information store.
> I strongly believe that much of the stability of my first attempt
> (as most likely, with taking MacZFS forward) stems from this. All
> those issues went away when I re-ported the FreeBSD work into
> Will's wrappers.
??? Having z_phys referenced in the znode is original Solaris design,
as early as October 2005.
Side note: You did meant "instability" above, not "stability"?
> This is also why XATTR, mmap and getdirattr took so long to go
> back into the development version, as it needed to be re-ported to
> not use z_phys, and generally be inspected. And those 3 functions
> in particular, still are not quite correct. (mmap)
>
> If you diff, for example, zfs_vnops.c with FreeBSD, you will find
> only irrelevant changes. I feel very good about how clean this
> current version is. But if you are not as familiar with the
> current sources, it will feel unknown and hacky, I am sure.
>
> I am grateful that Will did the VNOP wrappers, as it turned out to
> be the best thing ever.
Good and informative write-up of the current state. Clarifies several
things.
>> - I have the feeling, the real interaction of VFS and ZPL and
>> its SA code is not fully understood.
>>
>>
> I would think this stems from unfamiliarity with the particular
> sources, and you should simply familiarise yourself with it. To
> use your words, "I feel" this is an issue you have, and not an
> issue with the project..
(2)
It is an impression I have, and impressions can be false. I would
have preferred to read something about it before it was pulled in,
maybe a reference to some old FreeBSD discussion. Again, just adding
a larger code blob, even if just moved from elsewhere, without arguing
why it is right, is something I am not used to.
>> - ZoL gave us a quick start, but it is itself a port of Illumos
>> code, to a kernel different from MacOSX/Darwin and
>> Solaris/Illumos.
>>
>
> If only I had 100 yen for every time someone asks me why I ported
> ZOL. :) When I started with ZOL, essentially all I did was take
> the autoconf build environment, and the header locations. ZOL has
> a *strong* separation between ZFS and SPL. And again, a *strong*
> separation between SPL and the kernel. All in a self contained
> autoconf set of directories.
>
> FreeBSD, IllumOS, do not. It is ingrained with the kernel build
> process, using direct kernel calls, rather than being forced
> through SPL. (ZOL does have an exception to this, the zvol.c stuff
> is Linux kernel, rather than using SPL in between. They should fix
> this)
>
> So, autoconf, directory layout, headers, and if you will,
> repository history, comes from ZOL. The core ZFS is the same for
> any platform. The "5 files" that interface with VFS, is from
> FreeBSD. Almost untouched. Which is almost untouched from IllumOS.
> That is the whole point with SPL (and FreeBSD's 'opensolaris'
> modules). The ZFS sources remain mostly untouched. There is
> nothing ZOL about it.
Having a separated porting layer is in my view the single advantage of
ZoL compared to IllumOS.
> Having said that, because it is connected to ZOL's repository,
> when we are ready, I can git merge in the new features, like lz4.
> If we were based on IllumOS or FreeBSD, this would be a manual
> process. With ZOL it *could* be a 'mostly automatic' situation.
We have had scripts to automatically extract and merge the ZFS related
changes from OpenSolaris repository. They haven't been used for some
time, but in principle should work with IllumOS.
Of course, it is more convenient to let other people (ZoL) do that for
us.
> Naturally, if OpenZFS happens, with its own repository, that would
> be most excellent.
At least one more thing we agree on.
>>
>> - SPL, coming from ZoL, is designed for Linux and now adapted to
>> MacOSX. Not the most direct approach.
>>
>>
> Not at all. SPL autoconf comes from ZOL. The source and headers
> come from MacZFS. The rest I wrote.
>
>
>> Looking at the commit history, I would suggest to leave the
>> current code behind and do a fresh clone. This fresh clone
>> could then be carefully re-ported, using all the insights gained
>> in the past three months, and avoiding short-cuts taken in the
>> rapid "make it run" phase.
>>
>>
> I have already done a fresh clone, and I re-ported things 'much
> slower'. I understand you like to work with ... 'glacial pace'..
> perhaps, and you could certainly still do that.
:-) I like the term "glacial pace", I haven't heard it before.
Although it is less a "like to" then a "have only the weekends" kind
of story.
> Last not least, and that is a real *show-stopper* for me, ZoL
> comes
>
>> with SPL which is GPL-licensed. There is *no* legal way, to
>> have CDDL and GPL in the same binary.
>>
>>
> It concerns me that you would rather 'not have ZFS at all' than
> having 'ZFS with the possibility of GPL'. That you would
> essentially risk the death of a project, over something so
> irrelevant.
It is not "not have ZFS at all" vs. "ZFS with the possibility of GPL".
MacZFS is ZFS without GPL. ZEVO is ZFS without GPL. It is more
respecting the law and following a clean approach. For example, one
could think of using FreeBSD and its 'opensolaris' module to speed up
MacZFS. Something actually discussed last year, before Alex went AWOL.
> BUT, this is my view. I do not care at all about licenses. But
> others do, so be it.
>
> As I have already stated, everything in SPL came from MacZFS, or
> written by me directly. None of the sources came from ZOL. Now,
> you are most likely jumping up and down right now as there is
> probably some LICENSE file, or Headers that start with GPL in
> there. This is because *I don't care about licenses*. I did not
> bother deleting, or updating the "header headers". Simply pasted in
> the code I needed.
Actually, there are 168 files with GPL header in the zfs-osx / spl
repository.
> The license of SPL is whatever MacZFS was, and whatever I say my
> code is. So for those that care about licenses, please make it say
> whatever makes you happy. I give you permission to make my code
> whatever license you desire.
>
> That aside, The US government funded the Lawrence Livermore
> National Laboratory to port ZFS to Linux, and their lawyers
> decided that the licensing of GPL and CDDL is not an issue. Or at
> least, when kept in SPL and ZFS modules.
>
> Do you believe you know better than them?
They are lawyers, I am not. So by definition, they are more
knowledgeable in this field. Nevertheless, LLNL avoided the whole
problem, by never releasing a binary kernel module. They just release
source code, which in any case is not a problem, since the GPL, as far
as I understand it, is only concerned about distributing a singe
derived work, i.e. a binary.
>>
>> - Upstream: Keep ZoL or switch to Illumos. Consider the Open
>> ZFS project
>>
http://2013.eurobsdcon.org/eurobsdcon-2013/talks/#AhrensMatuska
>>
>>
> ZFS sources are just ZFS sources. All glue is kept in SPL and
> "opensolaris" modules. The upstream repository is irrelevant.
> However, if OpenZFS gets its own repository, I am all for making
> it our upstream.
Open ZFS, once established, is certainly the repository I would
consider first.
>> - Memory management: See if and what parts need to be wired, and
>> what parts can be swappable kernel memory. Think about "last
>> resort" memory pools.
>>
>>
> This definitely needs work. We currently run out quite easily.
> Mainly because we only keep a total tally of allocations, when OS X
> keeps a separate list for each size (256, 512, 1024, ...) and we
> often run out of 512 or 1024 first. We might need to do more
> kernel linking hacks to gain access to the memory allocators so we
> can detect if we are about to run out. (hah! I only said that for
> the effect. But we do need to do something here).
Currently, I don't know how to best approach the memory management.
Something to research and then decide.
>> - mmap & Co: Should parts of ARC be bundled with the UBC? (This
>> is probably a long-term question to be addressed *after* the
>> first public release.)
>>
>>
> That would be nice.
>
>
>
>> - Untangle OSX vn_xxx and vnode_xxx calls as much as possible
>> from the znode code. The gold standard here is the CDDL part of
>> ZEVO, which shows how clean one can get the znode.c
>>
>>
> Our (current) znode is cleaner than ZEVOs. Unless you refer to the
> headers and the "ZEVO_SPECIFIC_FIELDS_HERE;" mess... brrr.
Nice to read, and another thing that happened silently. I am some days
behind in following what you did. Well, probably more some weeks.
>> - Further explore Will's osx-vfs-wrappers approach (merged in
>> zfs-osx master). May conflict with "Untangle OSXvn_xxx and
>> vnode_xxx calls"
>>
>
> Already in, and working beautifully.
>
>
>>
>> - make sure eject and export work and allow unload of the kext.
>> Don't panic on unexpected vdev detach (i.e. "pulling the plug"
>> of an external enclosure).
>>
>
> Never heard of this panic. But I haven't tried it either.
>
>
>>
>> - support for all architectures and OSX releases (PPC, I386,
>> X86_64, Leopard to Maverick)
>>
>>
> I support 32bit/64bit, 10.6 to 10.9+. But PPC and earlier I
> consider irrelevant. Hell, Apple has already cut support of them
> off. We might even have to let go of 32bit realistically, but my
> home machine is still stuck on 10.6.
As are mine. I have no intention to update to Lino or Mountain Lion.
From what I saw so far, Snow Leopard is the last usable release of
Mac OSX, before Apple started to iOS-ify the Desktop.
Regarding PPC, there are quite some old PPC-based Xserve out there and
still in production.
> Please ask me to clarify something if I am not entirely clear.
> English is my third language after all, as it is to many others in
> here.
I had no problems following your English. To me, as a non-native, it
looks like pretty high standard.
> I think many things we can compromise on just fine, which is why
> we are having this discussion.
I tried to answer all the concerns. The red line for me is ignoring
licenses.
(3)
A big concern for me is long-term maintainability and stability.
I may be mistaken, but my impression is, that the existing MacZFS user
base is rather conservative, valuing stability over features, but of
course happy for each new feature we can deliver. Many in the
community use MacZFS in production, some in their business. This puts
a lot of responsibility on the project maintainers.
Best regards
Björn
- --
| Bjoern Kahl +++ Siegburg +++ Germany |
| "googlelogin@-my-domain-" +++
www.bjoern-kahl.de |
| Languages: German, English, Ancient Latin (a bit :-)) |
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.13 (Darwin)
Comment: Using GnuPG with Thunderbird -
http://www.enigmail.net/
iQCVAgUBUctW+1sDv2ib9OLFAQL39QQAt2hp8/NS6X9ER5VcHcSHtXtG7xWPG0Zd
f16nBG39a6v6/e5pb8hmRAUBZe9+InFzPP/VrpTTLvhFTmswTipL9D/7nTptM7yv
vFa0qH+VpyLlwHnLF8BEGwe7HVcO8UR2rPI6709yU4o7qJALWyuJvQnBiW3z6XXA
9QZyaIrscEw=
=MIzv
-----END PGP SIGNATURE-----