From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Dave Hansen <dave@linux.vnet.ibm.com>, Nitin Gupta <ngupta@vflare.org>
Cc: Seth Jennings <sjenning@linux.vnet.ibm.com>,
Greg KH <greg@kroah.com>,
gregkh@suse.de, devel@driverdev.osuosl.org,
cascardo@holoscopio.com, linux-kernel@vger.kernel.org,
linux-mm@kvack.org, brking@linux.vnet.ibm.com,
rcj@linux.vnet.ibm.com
Subject: RE: [PATCH v2 0/3] staging: zcache: xcfmalloc support
Date: Tue, 4 Oct 2011 18:03:00 -0700 (PDT) [thread overview]
Message-ID: <77608af6-a747-47f6-81ac-e1379f75fd65@default> (raw)
In-Reply-To: <1317666154.16137.727.camel@nimitz>
> From: Dave Hansen [mailto:dave@linux.vnet.ibm.com]
> Sent: Monday, October 03, 2011 12:23 PM
> To: Nitin Gupta
> Cc: Dan Magenheimer; Seth Jennings; Greg KH; gregkh@suse.de; devel@driverdev.osuosl.org;
> cascardo@holoscopio.com; linux-kernel@vger.kernel.org; linux-mm@kvack.org; brking@linux.vnet.ibm.com;
> rcj@linux.vnet.ibm.com
> Subject: Re: [PATCH v2 0/3] staging: zcache: xcfmalloc support
>
> On Mon, 2011-10-03 at 13:54 -0400, Nitin Gupta wrote:
> > I think disabling preemption on the local CPU is the cheapest we can get
> > to protect PCPU buffers. We may experiment with, say, multiple buffers
> > per CPU, so we end up disabling preemption only in highly improbable
> > case of getting preempted just too many times exactly within critical
> > section.
>
> I guess the problem is two-fold: preempt_disable() and
> local_irq_save().
>
> > static int zcache_put_page(int cli_id, int pool_id, struct tmem_oid *oidp,
> > uint32_t index, struct page *page)
> > {
> > struct tmem_pool *pool;
> > int ret = -1;
> >
> > BUG_ON(!irqs_disabled());
>
> That tells me "zcache" doesn't work with interrupts on. It seems like
> awfully high-level code to have interrupts disabled. The core page
> allocator has some irq-disabling spinlock calls, but that's only really
> because it has to be able to service page allocations from interrupts.
> What's the high-level reason for zcache?
>
> I'll save the discussion about preempt for when Seth posts his patch.
I completely agree that the irq/softirq/preempt states should be
re-examined and, where possible, improved before zcache moves
out of staging.
Actually, I think cleancache_put is called from a point in the kernel
where irqs are disabled. I believe it is unsafe to call a routine
sometimes with irqs disabled and sometimes with irqs enabled?
I think some points of call to cleancache_flush may also have
irqs disabled.
IIRC, much of the zcache code has preemption disabled because
it is unsafe for a page fault to occur when zcache is running,
since the page fault may cause a (recursive) call into zcache
and possibly recursively take a lock.
Anyway, some of the atomicity constraints in the code are
definitely required, but there are very likely some constraints
that are overzealous and can be removed. For now, I'd rather
have the longer interrupt latency with code that works than
have developers experimenting with zcache and see lockups. :-}
Dan
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2011-10-05 1:03 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-07 14:09 [PATCH v2 0/3] staging: zcache: xcfmalloc support Seth Jennings
2011-09-07 14:09 ` [PATCH v2 1/3] staging: zcache: xcfmalloc memory allocator for zcache Seth Jennings
2011-09-07 14:09 ` [PATCH v2 2/3] staging: zcache: replace xvmalloc with xcfmalloc Seth Jennings
2011-09-07 14:09 ` [PATCH v2 3/3] staging: zcache: add zv_page_count and zv_desc_count Seth Jennings
2011-09-09 20:34 ` [PATCH v2 0/3] staging: zcache: xcfmalloc support Greg KH
2011-09-10 2:41 ` Nitin Gupta
2011-09-12 14:35 ` Seth Jennings
2011-09-13 1:55 ` Nitin Gupta
2011-09-13 15:58 ` Seth Jennings
2011-09-13 21:18 ` Nitin Gupta
2011-09-15 16:31 ` Seth Jennings
2011-09-15 17:29 ` Dan Magenheimer
2011-09-15 19:24 ` Seth Jennings
2011-09-15 20:07 ` Dan Magenheimer
2011-10-03 15:59 ` Dave Hansen
2011-10-03 17:54 ` Nitin Gupta
2011-10-03 18:22 ` Dave Hansen
2011-10-05 1:03 ` Dan Magenheimer [this message]
2011-09-15 22:17 ` Dave Hansen
2011-09-15 22:27 ` Dan Magenheimer
2011-09-16 17:36 ` Nitin Gupta
2011-09-16 17:52 ` Nitin Gupta
2011-09-16 17:46 ` Nitin Gupta
2011-09-16 18:33 ` Seth Jennings
2011-11-01 17:30 ` Dave Hansen
2011-11-01 18:35 ` Dan Magenheimer
2011-11-02 2:42 ` Nitin Gupta
2011-09-29 17:47 ` Seth Jennings
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=77608af6-a747-47f6-81ac-e1379f75fd65@default \
--to=dan.magenheimer@oracle.com \
--cc=brking@linux.vnet.ibm.com \
--cc=cascardo@holoscopio.com \
--cc=dave@linux.vnet.ibm.com \
--cc=devel@driverdev.osuosl.org \
--cc=greg@kroah.com \
--cc=gregkh@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=ngupta@vflare.org \
--cc=rcj@linux.vnet.ibm.com \
--cc=sjenning@linux.vnet.ibm.com \
/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;
as well as URLs for NNTP newsgroup(s).