Gentoo Archives: gentoo-user

From: Michael Mol <mikemol@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Beta test Gentoo with mdev instead of udev; version 5 - failure :-(
Date: Wed, 14 Mar 2012 19:42:17
Message-Id: CA+czFiBpNBEaf+vGzEZNrtMD76UUFMuNHnBBTv=x5h2D5MLZJA@mail.gmail.com
In Reply to: Re: [gentoo-user] Beta test Gentoo with mdev instead of udev; version 5 - failure :-( by "Canek Peláez Valdés"
1 On Wed, Mar 14, 2012 at 2:45 PM, Canek Peláez Valdés <caneko@×××××.com> wrote:
2 > On Wed, Mar 14, 2012 at 12:09 PM, Michael Mol <mikemol@×××××.com> wrote:
3 >> On Wed, Mar 14, 2012 at 1:22 PM, Canek Peláez Valdés <caneko@×××××.com> wrote:
4 >>> On Wed, Mar 14, 2012 at 9:16 AM, Alan Mackenzie <acm@×××.de> wrote:
5 >>>> Hello, Canek
6 >>>>
7 >>>> On Tue, Mar 13, 2012 at 06:07:32PM -0600, Canek Peláez Valdés wrote:
8 >>>>> On Tue, Mar 13, 2012 at 5:03 PM, Alan Mackenzie <acm@×××.de> wrote:
9 >>>>
10 >>>>> > The new hardware will "just work" if there are the correct drivers
11 >>>>> >built in.  That's as true of udev as it is of mdev as it is of the old
12 >>>>> >static /dev with mknod.
13 >>>>
14 >>>>> No, it is not. You are letting out the sine qua non of the matter: the
15 >>>>> device has to be built, *and the /dev file should exists*. I hope you
16 >>>>> are not suggesting that we put *ALL* the possible files under /dev,
17 >>>>> because that was the idea before devfs, and it doesn't work *IN
18 >>>>> GENERAL*.
19 >>>>
20 >>>> Previously you made appropriate /dev entries with mknod, giving the
21 >>>> device major and minor numbers as parameters.  This appeared to work in
22 >>>> general - I'm not aware of any device it didn't work for.
23 >>>
24 >>> Again, I believe you are not following me. In *general* the number of
25 >>> potential device files under /dev is not bounded. Given N device
26 >>> filess, I can give you an example where you would need N+1 device
27 >>> files. With your experience, I assume you know about huge arrays of
28 >>> SCSI disks, for example; add to that whatever number of USB devices
29 >>> (and the hubs necessary to connect them), whatever number of Bluetooth
30 >>> thingies, etc., etc.
31 >>>
32 >>>  Therefore, mknod doesn't solve the problem in general, because I can
33 >>> always give an example where the preset device files on  /dev are not
34 >>> enough.
35 >>
36 >> And I can always give an example where there can't be enough inodes
37 >> (or perhaps even RAM) to contain enough device nodes. "General Case"
38 >> is a beautiful thing for a theoretical system, but my computer is not
39 >> a theoretical system. Neither is my phone, or my server.
40 >
41 > You are arguing that the mknod method should be used? Because that
42 > dicussion happened ten years ago; that train is long gone. If you want
43 > to argue with someone about it, it would not be me.
44
45 No, I was taking your argument to its perceived end result. You want
46 the universal solution, but that requires limitless resources in
47 things like memory and integer sizes. The software doesn't exist
48 within such an environment. The assumptions which it's already
49 depending on limit its utility in lower-end hardware.
50
51 >
52 >>
53 >>>
54 >>>>> So, you need something to handle device files on /dev, so you don't
55 >>>>> need every possible device file for every possible piece of hardware.
56 >>>>> But then you want to handle the same device with the same device name,
57 >>>>> so you need some kind of database. Then for the majority of users,
58 >>>>> they want to see *something* happen when they connect aa piece of
59 >>>>> hardware to their computers.
60 >>>>
61 >>>> That happened under the old static /dev system.  What was that /dev
62 >>>> system, if not a database matching /dev names to device numbers?  I'm not
63 >>>> sure what you mean by "same device" and "same device name".
64 >>>
65 >>> That if I connect a USB wi-fi dongle, and it appears with the name
66 >>> wlan23, I want *every* time that dongle to have the wlan23 name .Good
67 >>> luck doing that without a database.
68 >>
69 >> udev does something nice here, and I believe mdev is capable of
70 >> similar. sysfs exports device attributes such as model and serial
71 >> number, and you could trivially derive the node name from that.
72 >
73 > I think (as does the udev maintainers) that there should be a strong
74 > coupling between the device manager, the database handling, and the
75 > firing of scripts. Otherwise. we get back to devfs, which again, that
76 > train is long gone.
77
78 From the sound of it, it sounds like mdev matches that description.
79 mdev supports the renaming of devices, so there's your database. It
80 supports firing scripts.
81
82 >
83 >>>
84 >>>>> So you need to handle the events associated with the connections (or
85 >>>>> discovery, for things like Bluetooth) of the devices, and since udev is
86 >>>>> already handling the database and the detection of
87 >>>>> connections/discovery, I agree with the decision of leting udev to
88 >>>>> execute programs when something gets connected. You could get that
89 >>>>> function in another program, but you are only moving the problem, *and
90 >>>>> it can also happen very early at boot time*, so lets udev handle it all
91 >>>>> the time.
92 >>>>
93 >>>> Early in boot time, you only need things like disk drives, graphic cards
94 >>>> and keyboards.  Anything else can be postponed till late boot time.
95 >>>
96 >>> Bluetooth keyboards. Done, you made my system unbootable when I need
97 >>> to run fsck by hand after a power failure.
98 >>
99 >> The userland bluetooth stack is an abomination. (Actually, the _whole_
100 >> bluetooth stack is an abomination. You don't want to know what
101 >> embedded developers who build car stereos and the like have to go
102 >> through to try to test things. Or what real packets fundamentally look
103 >> like 'on the wire'.)
104 >>
105 >> It needs a real overhaul. I used to use a bluetooth keyboard, but I
106 >> found it to be a real mess. I even joined the Linux Documentation
107 >> Project with the intent of getting bluetooth profiles, apps and stacks
108 >> indexed and cross-referenced, but there's just way too much going
109 >> wrong with bluetooth. I eventually switched to using a propriety
110 >> wireless keyboard, and relegated the bluetooth keyboard to secondary
111 >> access and to controlling the PS3.
112 >>
113 >> Besides, your BIOS isn't going to support bluetooth, either; if you're
114 >> concerned about failure-case recovery, and you don't have a keyboard
115 >> you can navigate your BIOS with, you're very probably doing something
116 >> wrong.
117 >
118 > BIOS is going the way of the dodo too, but that's besides the point.
119
120 No, it's really not. Replace 'BIOS' with 'UEFI' or whatever you like;
121 you still need _something_ to handle initial hardware initialization
122 which has device-specific knowledge. And if your UEFI firmware
123 supports Bluetooth, whether the OS supports it or not becomes a moot
124 point; you can use a legacy support mechanism such as the ones that
125 allowed me to use USB keyboards in DOS. (Yes, I've done that.)
126
127 > I'm actually quite happy with the Linux bluetooth stack (which, if I'm
128 > not mistaken, is used by Android). I have several bluetooth thingies,
129 > they all work great.
130
131 Go look at the spec. Go look at the list of existing Bluetooth
132 profiles. Sit down and _study_ this thing which you keep holding up as
133 an example. You've had someone else do all the work for you, and I
134 don't think you understand how much of a mess it really is. I would
135 have loved to set up a huge amount of stuff piped and routed via
136 bluetooth as a PAN, but outside of a few core profiles with de facto
137 support, nothing really interoperates well.
138
139 >
140 >
141 >>>
142 >>>>> I hope you see where I'm going. As I said before, mdev could (in
143 >>>>> theory) do the same that udev does. But then it will be as complicated
144 >>>>> as udev, *because it is a complicated problem* in general. And I again
145 >>>>> use my fuel injection analogy: it is not *necessary*. It is just very
146 >>>>> damn convenient.
147 >>>>
148 >>>> It may be a complicated problem in general, but many people do not need
149 >>>> that generality.
150 >>>
151 >>> ^^^^^ That's your mistake! (IMHO). I explain below.
152 >>>
153 >>>> I suspect the vast majority don't need it.  Neither the
154 >>>> typical desktop, the typical server, nor typical embedded devices like
155 >>>> routers.
156 >>>
157 >>> Alan, the "vast majority" of Linux users right now are phone users.
158 >>
159 >> Phone users are _excellent_ examples of embedded environments. You
160 >> have a static hardware set, where you can predict darn near everything
161 >> about it that you might possibly need during a boot sequence. You're
162 >> not expected or intended to cope with boot failures. Your bluetooth
163 >> earpiece and input devices can wait until the OS has loaded.
164 >>
165 >> This is exactly the kind of environment where I would expect udev to
166 >> _not_ be necessary during boot.
167 >
168 > The phones/tablets of now have everything but a "static hardware set".
169 > The connect (wirelessly usually) with a lot of things, and they have
170 > USB and SD besides. So I would expect udev to *be* necessary with
171 > them.
172
173 For boot?
174
175 Also, you want udev to handle wifi? Bluetooth, I could see, but wifi
176 belongs elsewhere; AFAIK, the kernel doesn't send hotplug events for
177 visible networks.
178
179 USB (client mode, not host mode) and SD, sure, you want a hotplug
180 handler. But that's not necessary during boot, and there's nothing
181 dynamic about them apart from they're either active or they're not.
182 They'll have static hardware positions. You won't be adding and
183 removing them.
184
185 USB host most (which few mobile devices have, but some do) is a
186 different animal, but, again, not something typical (your mainstream,
187 mass market, majority of Linux users) mobile and embedded devices need
188 to care about at boot.
189
190 >
191 > I'm still wainting for someone to tell me how mdev handles bluetooth.
192
193 I'm still waiting for you to explain why bluetooth makes sense for
194 your boot-failed device.
195
196 >
197 >>> That was my initial point some mails ago. What *you* believe are
198 >>> "regular" users (people like you, or maybe even me), stopped being
199 >>> true a couple of years ago. The days of the Unix admin and workstation
200 >>> user are going the way of the dodo.
201 >>>
202 >>> At least, that's how I see it.
203 >>
204 >> I can only assume you've run a server. I expect you currently run at
205 >> least one. If you haven't, then you _really_ have no standing to argue
206 >> that server environments are irrelevant; you'd be belying a massive
207 >> lack of understanding of systemic, practical and operational context.
208 >> I can't _imagine_ you expect the client/server architecture of the
209 >> Internet to go away in the near future. You're very explicitly talking
210 >> about sacrificing Linux's efficiency in a server environment in favor
211 >> of The General Case, which is a case which should only be needed once
212 >> the system has already booted.
213 >
214 > "sacrificing Linux's efficiency in a server environment"? What are you
215 > talking about? I run my servers with udev... *and* systemd. Have you
216 > tried it? Are you *sure* it's less efficient, or it seems so to you
217 > "in theory"?
218
219 The more complicated the software, the more RAM, CPU and disk it must
220 consume. Ergo, by increasing resource usage in one area, you decrease
221 its availability in another area.
222
223 There's the theory. And, yes, I do run udev on my servers, because my
224 servers aren't such that I want to poke and prod with alternatives
225 quite yet. Someday, I very probably will run mdev, because I see the
226 memory, CPU and RAM counters for the three udev instances on my
227 server, and I want those resources for something else, because I
228 _care_ about the performance of my server. And I'd care even more if I
229 was trying to fit things inside 2MB of RAM instead of 2GB or 4GB of
230 RAM.
231
232 >
233 > More complex doesn't mean less efficient: again, look at the fuel
234 > injection analogy. It's incredible complex, but it gives you *more*
235 > fuel efficiency.
236
237 In a dynamic system, perhaps. A server is certainly not a dynamic
238 system. The boot sequence of my phone does not need to be a dynamic
239 system. The boot sequence of my tablet does not need to be a dynamic
240 system.
241
242 >
243 > The general  solution is *specially* important for the server case.
244 > Kay and Lennart work for RedHat, and be sure RHEL will have udev and
245 > systemd at some point. And guess what? I'm willing to bet another beer
246 > that it would be more efficient.
247
248 I think you and I are at some strong disagreement by which we count efficiency.
249
250 >
251 >> We used to joke that emacs would be a great operating system if only
252 >> it had drivers. From your arguments and positions, it's looking like
253 >> udev is setting itself to be the next target of similar jokes.
254 >
255 > Maybe it's coincidence, but I still use Emacs ;)
256 >
257 > Read the last mail from Greg KH in the -dev list: more coupling is
258 > what most of the devs are looking for, because *it solves more cases*
259 > of the general problem.
260
261 Sure. People like integration, because standardizing interoperability
262 of discrete pieces in a system requires cooperation, and is thus more
263 difficult. Making a monolith, though, almost invariably makes
264 maintenance more difficult in the long term. Going back to cars, I
265 can't use an engine from a Ford in a Hyundai, because their interfaces
266 aren't standardized. I can take a video card from a Dell and put it in
267 a Lenovo, though, because those interfaces _are_ standardized.
268
269 >
270 >>
271 >>>
272 >>>>> I have a really time understanding why you don't see the complexity on
273 >>>>> the problem. I explained above: it is a complicated problem (when
274 >>>>> dealing with the general case), and therefore the (general) solution is
275 >>>>> bound to be also complicated.
276 >>>>
277 >>>> I've had a hard time understanding, because up till now, nobody's
278 >>>> described the problem in detail - there's only been hand-waving.
279 >>>>
280 >>>>> You want it simple? Tha'ts fine, it is possible. It's just that it
281 >>>>> will not solve the general problem, just a very specific subset of it.
282 >>>>
283 >>>> That subset used by the vast majority of Linux users.
284 >>>
285 >>> Again, think about phones. And tablets. And TVs. And
286 >>> [insert-here-cool-gadgets-from-the-future].
287 >>
288 >> See my argument above about static, predictable hardware,
289 >> strictly-defined boot process and clear stages of operation.
290 >
291 > Again, if it's simpler/easier, why has anybody implemented it?
292
293 Not sure exactly what you're asking/saying. What is "it" here? udev?
294 Because someone didn't like the status quo and came up with a
295 solution. And then the solution snowballed into something massive and
296 nowhere near as simple and elegant as its initial versions.
297
298 Yes, udev was once a pretty decent piece of software, but it's
299 reaching to cover too many different use paradigms, and *that's*
300 what's making it so complex. But people didn't really care until udev
301 decided that it was going to step away from trying to be
302 self-contained, and declared restrictions on the hosting environment.
303
304 *That* is taking a direct movement away from The General Case; they
305 redefined The General Case to something that was easier for them to
306 cope with.
307
308 > And
309 > please, don't say "mdev", because (as I have said), it doesn't work
310 > *right now* for all my use cases. When it does, I keep betting that it
311 > would be as complex as udev.
312
313 I'd bet it won't. And shouldn't. Because your use cases are outside
314 its target. (And, actually, your use cases are outside what your
315 hardware was designed to do. By forcing it out of its niche, you're
316 injecting inelegence into your own system.)
317
318 >
319 >>>
320 >>>>  And yes, I do want
321 >>>> it simple, because elegant simplicity is the best way, IMAO.  You, on the
322 >>>> other hand, seem to love complicated solutions because they are "the way
323 >>>> forward".  We'll have to agree to disagree on this one.
324 >>>
325 >>> No, it's not a matter of "that's the way forward". It's a matter of
326 >>> trying to solve the general problem. And since the general solution
327 >>> also solves the simple cases, I don't see a reason to waste my
328 >>> time/resources in a solution that in the end will not solve the
329 >>> general problem.
330 >>
331 >> Honestly, you're too dead set on finding a solution to the general
332 >> problem, because to solve the general problem, you must redefine
333 >> reality to cope with the limits of your theory. In order to handle the
334 >> burden of your general-case-software, hardware itself must become more
335 >> powerful and more expensive, which in turn will lead to greater
336 >> complexity for your general case. Old hardware, no longer capable of
337 >> running the general case software, even though it's a specific-case
338 >> device, is wastefully discarded.
339 >
340 > What are you talking about man? The "general problem", by definition,
341 > includes old hardware. That's why it's "general".
342
343 But the more complex you make the software, the more difficult it
344 becomes to fit it into old hardware.
345
346 >
347 > I think you guys are not seeing the forest because of all the trees.
348
349 I think you're forgetting that a forest is made of trees.
350
351 >
352 >>
353 >>>
354 >>> Of course, as I have been saying from the beginning, this is
355 >>> OpenSource. Want to pour some effort into solving the simple cases
356 >>> that will not help all the community, and that it will only help in
357 >>> fact a minority, that's your prerogative (and Walt's, and Vapier's,
358 >>> and everyone else that don't like the "complex" but complete
359 >>> solution). Go nuts with it if you want.
360 >>>
361 >>> But please don't dismiss the general solution as "unnecessary" complex
362 >>> when it's not the case, and don't think that the "simple" setups
363 >>> (whatever that means) are the majority. Again, think phones and
364 >>> tablets: those *are* the majority.
365 >>
366 >> Again, phones and tablets are simple cases.
367 >
368 > OK; call me when they use mdev.
369 >
370 >>>
371 >>>>> Just as mdev is doing; Walt just posted an email explaining that if
372 >>>>> you use GNOME, KDE, XFCE, or LVM2, mdev is not for you.
373 >>>>
374 >>>> Walter is, I believe, mistaken here.  I can mount and use my LVM2
375 >>>> partitions.  Gnome looks like it comes up OK, but that could be moot,
376 >>>> since right now I haven't got keyboard/mouse drivers under the X server.
377 >>>
378 >>> Oh, for sure you can modify LVM2 to work under mdev. Also
379 >>> GNOME/KDE/XFCE, and everything under the sun. You have the source; you
380 >>> can do *anything* you want with it.
381 >>>
382 >>> But the effort wasted^^^^^Hpoured in that excercise will only serve a
383 >>> handful of users, and it will be never accepted upstream, because
384 >>> upstream is (rightfully) concerned with the general problem.
385 >>
386 >> And here is the biggest reason I get frustrated with you. You say "go
387 >> ahead and try, you're wasting your effort. You're going to fail.
388 >> Everyone will leave you behind." It's an incredibly negative,
389 >> aggressive attitude which isn't geared toward finding a solution, but
390 >> is rather geared at reducing the problem.
391 >
392 > I'm just stating my opinion; if you find it "negative", well sorry.
393 > Disagree with me if you want, but (obviously) I don't think or see the
394 > problem as you guys. I'm not being "negative"; I'm just call'em as I
395 > see'em.
396 >
397 > And besides, it matters not what I say or don't say, because what
398 > matters is the *code*. And the code of udev works right now in the
399 > general case; mdev (as cute hack as it could be) doesn't. That's all
400 > what I'm saying.
401
402 Every time someone starts actually doing something about it, you tell
403 them they're wasting their time, and that they're doomed, but,
404 whatever, it's their time to waste.
405
406 That's pretty negative and condescending, and is polarizing the issue.
407
408
409 >
410 >
411 >>>
412 >>> Again, this is OpenSource: go nuts with any problem you find
413 >>> "interesting" (I really don't understand why solving a particular case
414 >>> of the general problem will be more interesting that solving the
415 >>> former, but that is maybe the Computer Scientist in me).
416 >>
417 >> That's exactly what it is. I have a _lot_ of interest in (and respect
418 >> for) computer science[1], but I also have several years of practical,
419 >> real-world software development. I have the privilege of being allowed
420 >> to see and participate in both the realms of theory and of practice.
421 >>
422 >> I'm not the smartest or most knowledgeable guy on this mailing list,
423 >> but I think I might know enough to say that, yes, you have too strong
424 >> a focus on the general case.
425 >
426 > Wellm, yes. That's what I have been saying.
427
428 You're saying you're too focused? I haven't seen that except for one paragraph.
429
430 >
431 >>
432 >>>
433 >>> I'm more interested in the general solution that will work not only
434 >>> for my current machines, but also for the ones I'm planning to have in
435 >>> the future. I'm dying to get a tablet where I can put GNOME 3 on it; I
436 >>> can bet you another beer that mdev will be not enough to handle that.
437 >>
438 >> The fundamental problem, as I see it, is that udev's role currently
439 >> encompasses both runtime hotplug events and boot-time
440 >> responsibilities. Those need to be separated. How? I don't have a
441 >> quick or easy answer, but that's where I see the systemic problem.
442 >> (And, no, I won't suggest that HAL is the solution.)
443 >
444 > Again, read about devfs. Tighly coupling is the path the developers
445 > (in general) are taking. I agree with them.
446
447 I remember devfs. Never wound up using it, myself, but I followed the
448 drama via kerneltrap and diff -u.
449
450 There is no such thing as a one-size-fits-all solution, but that's not
451 something you seem to grasp yet.
452
453 >
454 >
455 >>
456 >>>
457 >>>>> I will not be surprised if in the future the list of programs "not for
458 >>>>> mdev" only grows.
459 >>>>
460 >>>> There's a difference between "needed by portage" and "doesn't work under
461 >>>> mdev".  As I say, it will all be moot if the evdev driver won't work
462 >>>> under mdev.
463 >>>
464 >>> With all due respect, Alan (and this is completely sincere, in this
465 >>> list you are of the guys I respect the most), I believe you are
466 >>> thinking too small.
467 >>
468 >> And I think you're thinking too big.
469 >
470 > Thank you.
471 >
472 >> Every case you would reach for to
473 >> cover with your general case, there will be a case just outside your
474 >> reach. At some point, you need to express limits. Limits are fine.
475 >> Limits can be practical. Heck, reasonable limits make practice easier,
476 >> because known constraints help one predict the behavior of the system.
477 >
478 > I know limits. udev has a lot of limitations; but it can do anything
479 > mdev can, and more. I'm not talking from a pure theoretical POV.
480
481 You're thinking about algorithmic limits. I'm talking about practical
482 limits like bytes, counts and CPU cycles.
483
484 >
485 >>>
486 >>> Right now Linux runs in my phone, my TV's, my routers and every
487 >>> computer I own. I have a couple of Windows installations, which I use
488 >>> once or twice every three months (I ported a PyGTK program to Windows
489 >>> last week, so I had to boot into Windows for the first time this
490 >>> year). I want Linux running on *everything*, and what is more: I don't
491 >>> want android in my handhelds, I want the full GNOME experience.
492 >>
493 >> BTW, you've put yourself into a niche here; you want a general-purpose
494 >> platform in embedded devices, but that's not the environment you've
495 >> argued the majory of Linux users exist in. I agree the majority of
496 >> Linux users are probably running Android at this point. They're not
497 >> running a general-purpose platform.
498 >
499 > And the devs are planning on changing that ;) That's the whole point
500 > of all this udev mess.
501
502 You're getting impossible to argue with. You've gone from
503
504 "most people using Linux are using Linux via Android"
505
506 to
507
508 "well, I don't want to use my embedded devices as embedded devices, I
509 want something more general than Android"
510
511 to
512
513 "the udev developers are working on changing embedded devices from
514 being embedded devices to being general-purpose devices."
515
516 Each time, you've acted as though the new stance is what you've been
517 arguing from all along, but because you haven't communicated that,
518 it's impossible to reasonably discuss specifics in practicality. I
519 think I'm done with this particular discussion.
520
521 --
522 :wq

Replies

Subject Author
Re: [gentoo-user] Beta test Gentoo with mdev instead of udev; version 5 - failure :-( "Canek Peláez Valdés" <caneko@×××××.com>