public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: "Artem B. Bityuckiy" <abityuckiy@yandex.ru>
To: Estelle HAMMACHE <estelle.hammache@st.com>
Cc: linux-mtd@lists.infradead.org, David Woodhouse <dwmw2@infradead.org>
Subject: Re: JFFS2 & SMP
Date: Thu, 04 Nov 2004 12:36:35 +0300	[thread overview]
Message-ID: <4189F823.2060204@yandex.ru> (raw)
In-Reply-To: <4189F07F.6495F568@st.com>

Estelle, I'm glad not to introduce new mutes, but I don't really know 
how to do so easy way.

 > I didn't check all the functions which
 > modify the wbuf variables so I don't know whether it is a
 > realistic idea or not.
I investigated this. These are:
jffs2_flash_writev()
__jffs2_flush_wbuf()
jffs2_wbuf_recover() too, but it is called only from __jffs2_flush_wbuf().

Anyway, all such functions are in wbuf.c

Basically, the c->alloc_sem protects the write buffer. It is logical to 
use it in the jffs2_flash_read() too. But the problem is that the 
jffs2_flash_read() is called by from many places and the c->alloc_sem 
may be already locked (when the jffs2_flash_read() is called from the 
Garbage Collector, for example) or not locked (when, for example, JFFS2 
performs the read_node() superblock operation).

Thus, we should introduce one more function parameter (like 
alloc_sem_is_set "boolean" flag) to distinguish if the alloc_sem is 
hold. It is possible too. But the jffs2_flash_read() functions is also 
called from many other functions, and we will need to add this parameter 
recursively to all of them (for example, jffs2_mark_node_obsolete()).

It seems the "down_trylock" decision is will not work.

So, I think this way is not very nice... Any suggestions?

Estelle HAMMACHE wrote:
> Hello Artem,
> 
> as I mentionned before I don't have linux so I can't really test
> your patch right now. I agree with the principle of your patch.
> I believe it should work this way.
> I was hoping the problem could be solved without introducing
> a new mutex, however I didn't check all the functions which
> modify the wbuf variables so I don't know whether it is a 
> realistic idea or not.
> bye
> Estelle
> 


-- 
Best Regards,
Artem B. Bityuckiy,
St.-Petersburg, Russia.

  reply	other threads:[~2004-11-04  9:37 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-27 12:35 JFFS2 & SMP Artem B. Bityuckiy
2004-10-27 12:59 ` David Woodhouse
2004-10-27 13:19   ` Artem B. Bityuckiy
2004-10-27 13:35   ` Artem B. Bityuckiy
2004-10-27 13:45     ` David Woodhouse
2004-10-27 14:09       ` Artem B. Bityuckiy
2004-10-27 14:59       ` Artem B. Bityuckiy
2004-10-27 15:07         ` Artem B. Bityuckiy
2004-10-28 12:14           ` Artem B. Bityuckiy
2004-10-28 12:33       ` Artem B. Bityuckiy
2004-10-28 13:57         ` Artem B. Bityuckiy
2004-11-02 14:31           ` Estelle HAMMACHE
2004-11-03 16:29             ` Artem B. Bityuckiy
2004-11-04  9:03               ` Estelle HAMMACHE
2004-11-04  9:36                 ` Artem B. Bityuckiy [this message]
     [not found]                   ` <418A591C.A4D46C9E@st.com>
2004-11-04 17:17                     ` Artem B. Bityuckiy
2004-11-05  9:06                       ` Estelle HAMMACHE
2004-11-05 11:51                         ` Artem B. Bityuckiy
2004-11-03 16:39             ` Artem B. Bityuckiy

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=4189F823.2060204@yandex.ru \
    --to=abityuckiy@yandex.ru \
    --cc=dwmw2@infradead.org \
    --cc=estelle.hammache@st.com \
    --cc=linux-mtd@lists.infradead.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