tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: crash in pipe_create() said:
> since we are allowed to wait, let uvm_km_alloc to wait also.

I think your patch makes most sense. (plus perhaps another
KASSERT after pool_cache_get() in pipe_create())

Since uvm_km_alloc(UVM_KMF_WAITVA) can never return failure
the pipe_ctor() will always succeed, and since
pool_alloc(PR_WAITOK) is not allowed to fail either it
should never happen that pool_cache_get(PR_WAITOK) fails.

Generally, pool_cache_get(PR_WAITOK) can fail, but only
if the pool_cache has a constructor which can return
an error. The pool_cache(9) manpage is not terribly
clear about that, but one can read it that way...
I've just found a single example of a constructor
function which can fail which is for uvm_uarea_cache.
(The error reporting is somewhat backwards there but
not incorrect.)
Since the caller of pool_cache_get() knows whether
its ctor function can return error it knows whether
it is necessary to check the result -- in our case
it should not be necessary (and pipe(2) should not
fail due to temporary resource shortage).

best regards

Forschungszentrum Juelich GmbH
52425 Juelich

Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzende des Aufsichtsrats: MinDir'in Baerbel Brumme-Bothe
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Dr. Ulrich Krafft (stellv. Vorsitzender), Prof. Dr. Harald Bolt,
Dr. Sebastian M. Schmidt

Home | Main Index | Thread Index | Old Index