Re: [RFC 3/3] SGI Altix cross partition memory (XPMEM)

From: Andrew Morton
Date: Fri Aug 10 2007 - 02:16:54 EST


On Thu, 9 Aug 2007 20:14:35 -0500 Dean Nelson <dcn@xxxxxxx> wrote:

> This patch provides cross partition access to user memory (XPMEM) when
> running multiple partitions on a single SGI Altix.
>

- Please don't send multiple patches all with the same title.

- Feed the diff through checkpatch.pl, ponder the result.

- Avoid needless casts to and from void* (eg, vm_private_data)

- The test for PF_DUMPCORE in xpmem_fault_handler() is mysterious and
merits a comment.

- xpmem_fault_handler() is scary.

- xpmem_fault_handler() appears to have imposed a kernel-wide rule that
when taking multiple mmap_sems, one should take the lowest-addressed one
first? If so, that probably wants a mention in that locking comment in
filemap.c

- xpmem_fault_handler() does atomic_dec(&seg_tg->mm->mm_users). What
happens if that was the last reference?

- Has it all been tested with lockdep enabled? Jugding from all the use
of SPIN_LOCK_UNLOCKED, it has not.

Oh, ia64 doesn't implement lockdep. For this code, that is deeply
regrettable.

- This code all predates the nopage->fault conversion and won't work in
current kernels.

- xpmem_attach() does smp_processor_id() in preemptible code. Lucky that
ia64 doesn't do preempt?

- Stuff like this:

+ ap_tg = xpmem_tg_ref_by_apid(apid);
+ if (IS_ERR(ap_tg))
+ return PTR_ERR(ap_tg);
+
+ ap = xpmem_ap_ref_by_apid(ap_tg, apid);
+ if (IS_ERR(ap)) {
+ xpmem_tg_deref(ap_tg);
+ return PTR_ERR(ap);
+ }

is fragile. It is easy to introduce leaks and locking errors as the
code evolves. The code has a lot of these deeply-embedded `return'
statments preceded by duplicated unwinding. Kenrel code generally
prefers to do the `goto out' thing.


- "XPMEM_FLAG_VALIDPTEs"? Someone's pinky got tired at the end ;)

Attention span expired at 19%, sorry. It's a large patch.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/