cmogstored dev/user discussion/issues/patches/etc
 help / color / mirror / code / Atom feed
From: Eric Wong <e@80x24.org>
To: cmogstored-public@bogomips.org
Subject: [PATCH 2/1] doc: further comment updates around ioq
Date: Sat, 24 Dec 2016 08:51:32 +0000	[thread overview]
Message-ID: <20161224085132.GA30062@starla> (raw)
In-Reply-To: <20161224083343.21879-1-e@80x24.org>

Let's not forget about this queue, it is a useful design.
---
 cmogstored.h | 10 +++++-----
 ioq.c        |  4 ++--
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/cmogstored.h b/cmogstored.h
index f5c682e..db87ac0 100644
--- a/cmogstored.h
+++ b/cmogstored.h
@@ -99,18 +99,18 @@ enum mog_next {
 struct mog_ioq {
 	unsigned cur;
 	unsigned max;
-	pthread_mutex_t mtx;
+	pthread_mutex_t mtx; /* protects cur, max, ioq_head */
 	SIMPLEQ_HEAD(ioq_head, mog_fd) ioq_head;
-	bool contended;
-	struct mog_svc *svc;
+	bool contended; /* hint, not protected */
+	struct mog_svc *svc; /* initialized once at creation */
 };
 
 struct mog_wbuf;
 struct mog_dev {
 	dev_t st_dev;
 	uint32_t devid;
-	struct mog_ioq ioq;
-	struct mog_ioq fsckq;
+	struct mog_ioq ioq; /* normal requests */
+	struct mog_ioq fsckq; /* low-priority for MogileFS fsck */
 };
 
 struct mog_rbuf {
diff --git a/ioq.c b/ioq.c
index c515a8b..9408786 100644
--- a/ioq.c
+++ b/ioq.c
@@ -37,7 +37,7 @@
  *                                 |                   /
  *                                 `---------<---------'
  *
- * mog_ioq_next is automatically called when releases a regular file.
+ * mog_ioq_next is automatically called when a thread releases a regular file.
  */
 __thread struct mog_ioq *mog_ioq_current;
 
@@ -140,7 +140,7 @@ void mog_ioq_next(struct mog_ioq *check_ioq)
 		mog_activeq_push(mog_ioq_current->svc->queue, mfd);
 	}
 	/*
-	 * We may not touch or use client_mfd here anymore.  Another
+	 * We may not touch mfd after mog_activeq_push.  Another
 	 * thread may already have it.  In the worst case, it's been
 	 * closed due to epoll/kqueue running out-of-space and another
 	 * system call (open/accept) may have already reused the FD
-- 
EW


      reply	other threads:[~2016-12-24  8:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-24  8:33 [PATCH] doc: documentation for ioq Eric Wong
2016-12-24  8:51 ` Eric Wong [this message]

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

  List information: https://yhbt.net/cmogstored/README

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161224085132.GA30062@starla \
    --to=e@80x24.org \
    --cc=cmogstored-public@bogomips.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.
Code repositories for project(s) associated with this public inbox

	https://yhbt.net/cmogstored.git/

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 read-only IMAP folder(s) and NNTP newsgroup(s).