From: Brice Goglin <Brice.Goglin@ens-lyon.org>
To: David Addison <addy@quadrics.com>
Cc: Andrew Morton <akpm@osdl.org>, Andrea Arcangeli <andrea@suse.de>,
Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH][RFC] Linux VM hooks for advanced RDMA NICs
Date: Thu, 28 Apr 2005 09:21:13 +0200 [thread overview]
Message-ID: <42708EE9.3010503@ens-lyon.org> (raw)
In-Reply-To: <426E62ED.5090803@quadrics.com>
> @@ -267,6 +270,11 @@
>
> unsigned long hiwater_rss; /* High-water RSS usage */
> unsigned long hiwater_vm; /* High-water virtual memory usage */
> +
> +#ifdef CONFIG_IOPROC
> + /* hooks for io devices with advanced RDMA capabilities */
> + struct ioproc_ops *ioproc_ops;
> +#endif
> };
> +int
> +ioproc_register_ops(struct mm_struct *mm, struct ioproc_ops *ip)
> +{
> + ip->next = mm->ioproc_ops;
> + mm->ioproc_ops = ip;
> +
> + return 0;
> +}
> +
> +EXPORT_SYMBOL_GPL(ioproc_register_ops);
> +
> +int
> +ioproc_unregister_ops(struct mm_struct *mm, struct ioproc_ops *ip)
> +{
> + struct ioproc_ops **tmp;
> +
> + for (tmp = &mm->ioproc_ops; *tmp && *tmp != ip; tmp= &(*tmp)->next)
> + ;
> + if (*tmp) {
> + *tmp = ip->next;
> + return 0;
> + }
> +
> + return -EINVAL;
> +}
> +
> +EXPORT_SYMBOL_GPL(ioproc_unregister_ops);
You don't seem to use any synchronization mechanism to protect the
ioproc list from concurrent modifications, right ?
I understand that it might be useless as long as QsNet is the only user
of ioprocs and takes care of locking the address space somewhere in the
driver before adding/removing hooks.
But, if this patch is to be merged to the mainline, you probably need
to do something here. It's not clear how other in-kernel users
(IB, Myri, Ammasso, ...) might use ioprocs.
And actually, I think all ioproc list traversal need to be protected
as well.
A spinlock_t ioproc_lock is probably appropriate here.
I don't know whether any of the existing locks in the task_struct
might be used instead.
Regards,
Brice
next prev parent reply other threads:[~2005-04-28 7:21 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-04-26 15:49 [PATCH][RFC] Linux VM hooks for advanced RDMA NICs David Addison
2005-04-26 16:57 ` Jesper Juhl
2005-04-26 17:13 ` Lee Revell
2005-04-26 17:20 ` Jesper Juhl
2005-04-26 17:28 ` Lee Revell
2005-04-26 17:38 ` Jesper Juhl
2005-04-26 20:14 ` John W. Linville
2005-04-26 20:17 ` Lee Revell
2005-04-26 20:09 ` Lars Marowsky-Bree
2005-04-28 11:34 ` Jakob Oestergaard
2005-04-29 8:22 ` Benjamin Herrenschmidt
2005-04-26 17:06 ` Brice Goglin
2005-04-27 9:41 ` David Addison
2005-04-28 8:38 ` Andy Isaacson
2005-04-27 13:43 ` Andi Kleen
2005-04-28 1:42 ` Troy Benjegerdes
2005-04-28 7:21 ` Brice Goglin [this message]
2005-04-28 9:21 ` David Addison
2005-04-29 8:19 ` Benjamin Herrenschmidt
2005-04-29 9:25 ` David Addison
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=42708EE9.3010503@ens-lyon.org \
--to=brice.goglin@ens-lyon.org \
--cc=addy@quadrics.com \
--cc=akpm@osdl.org \
--cc=andrea@suse.de \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox