|
|||||||||||
|
bk commit into 6.0 tree (hall:1.2628)
From: Christoffer Hall <hall(at)mysql.com>
Date: Thu Oct 11 2007 - 01:31:20 EDT
ChangeSet@1.2628, 2007-10-11 07:31:14+02:00, hall@helheim.(none) +5 -0 Aio fixes. storage/falcon/Aio.cpp@1.2, 2007-10-11 07:31:09+02:00, hall@helheim.(none) +24 -3 Aio fixes. storage/falcon/Aio.h@1.2, 2007-10-11 07:31:09+02:00, hall@helheim.(none) +1 -0 Aio fixes. storage/falcon/BDB.h@1.2, 2007-10-11 07:31:09+02:00, hall@helheim.(none) +2 -0 Aio fixes. storage/falcon/Cache.cpp@1.2, 2007-10-11 07:31:09+02:00, hall@helheim.(none) +22 -16 Move towards split submission and completion in page cache. storage/falcon/Cache.h@1.2, 2007-10-11 07:31:09+02:00, hall@helheim.(none) +1 -0 Add function. diff -Nrup a/storage/falcon/Aio.cpp b/storage/falcon/Aio.cpp --- a/storage/falcon/Aio.cpp 2007-10-08 08:59:57 +02:00 +++ b/storage/falcon/Aio.cpp 2007-10-11 07:31:09 +02:00@@ -109,11 +109,13 @@ Aio::~Aio() void Aio::signalAioRQ(AioRQ *rq) {
// singal BDB
void Aio::freeAioRQ(AioRQ *rq)
- Sync sync(&syncObject, "Aio::submitBdb"); }
+void Aio::submitWrite(Bdb* bdb, bool async)
+{
+ submitBdb(bdb, async, true);
+}
+
+void Aio::submitRead(Bdb* bdb, bool async)
+{
+ submitBdb(bdb, async, false);
+}
+
+void Aio::waitFor(Bdb* bdb)
+{
+ Log::debug("Waiting for bdb %d\n", bdb->pageNumber); + bdb->completion.sleep(); +} + void Aio::submitBdb(Bdb* bdb, bool async, bool isWrite) { @@ -165,8 +183,11 @@ void Aio::submitBdb(Bdb* bdb, bool async
rq->bdb = bdb;
rq->isWrite = isWrite;
+ Log::debug("Submitting to fd: %d offset %lld size %d\n", fd, rq->offset, rq->size);
if (async)
{
+
aioWorkers->startWhenever("Aio worker thread", Aio::aioWorkerThread, rq);
return;
}
@@ -196,7 +217,7 @@ void Aio::write(int64 offset, int32 size
rq->isWrite = true;
pwrite(rq);
- + freeAioRQ(rq); } void Aio::read(int64 offset, int32 size, UCHAR *buffer) @@ -214,6 +235,7 @@ void Aio::read(int64 offset, int32 size,
pread(rq);
+ freeAioRQ(rq); void Aio::aioWorkerThread(void *argument) @@ -222,7 +244,6 @@ void Aio::aioWorkerThread(void *argument
AioRQ *rq = (AioRQ *) argument;
Aio *aio = rq->aio;
- Sync sync(&aio->syncObject, "Aio::aioWorkerThread");
if (rq->isWrite)
aio->pwrite(rq);
else
diff -Nrup a/storage/falcon/Aio.h b/storage/falcon/Aio.h
--- a/storage/falcon/Aio.h 2007-10-08 08:59:57 +02:00
+++ b/storage/falcon/Aio.h 2007-10-11 07:31:09 +02:00
@@ -55,6 +55,7 @@ public:
void submitRead(Bdb *buffer, bool async);
void submitWrite(Bdb *buffer, bool async);
@@ -25,6 +25,7 @@
#endif // _MSC_VER >= 1000
#include "SyncObject.h"
//#define COLLECT_BDB_HISTORY
short flags; bool flushIt; volatile INTERLOCK_TYPE useCount; }
-void Cache::writePage(Bdb *bdb)
- if (!(bdb->flags & BDB_dirty))
- {
- //Log::debug("Cache::writePage: page %d not dirty\n", bdb->pageNumber);
- markClean (bdb);
- return;
- }
-
Dbb *database = bdb->dbb;
ASSERT(database);
- markClean (bdb);
- database->writePage(bdb);
-
-#ifdef STOP_PAGE
- if (bdb->pageNumber == STOP_PAGE)
- Log::debug("writing page %d/%d\n", bdb->pageNumber, dbb->tableSpaceId);
-#endif
-
+
+ //markClean (bdb);
+
bdb->flags &= ~(BDB_dirty | BDB_new);
if (pageWriter && (bdb->flags & BDB_writer))
@@ -557,6 +545,24 @@ void Cache::writePage(Bdb *bdb)
for (DatabaseCopy *shadow = database->shadows; shadow; shadow = shadow->next)
shadow->rewritePage(bdb);
}
+}
+
+void Cache::writePage(Bdb *bdb)
+{
+ if (!(bdb->flags & BDB_dirty))
+ {
+ //Log::debug("Cache::writePage: page %d not dirty\n", bdb->pageNumber);
+ markClean (bdb);
+ return;
+ }
+
+ Dbb *database = bdb->dbb;
+ ASSERT(database);
+ markClean (bdb);
+ //database->writePage(bdb);
+ database->submitWrite(bdb, false);
+ //database->waitFor(bdb);
+ writePageComplete(bdb); } void Cache::analyze(Stream *stream) diff -Nrup a/storage/falcon/Cache.h b/storage/falcon/Cache.h --- a/storage/falcon/Cache.h 2007-09-20 17:41:32 +02:00 +++ b/storage/falcon/Cache.h 2007-10-11 07:31:09 +02:00 @@ -50,6 +50,7 @@ public: void analyze (Stream *stream); void writePage (Bdb *bdb); void markClean (Bdb *bdb); -- MySQL Code Commits Mailing List For list archives: http://lists.mysql.com/commits To unsubscribe: http://lists.mysql.com/commits?unsub=lists@pantek.comReceived on Wed Nov 28 04:31:26 2007 This archive was generated by hypermail 2.1.8 : Thu Jul 03 2008 - 13:58:16 EDT |
||||||||||
|
|||||||||||