All of lore.kernel.org
 help / color / mirror / Atom feed
* [Ocfs2-devel] ocfs2: add extent block stealing for ocfs2 v1
@ 2009-12-14 10:47 Jun Yang
  2009-12-15  8:04 ` Tao Ma
  0 siblings, 1 reply; 4+ messages in thread
From: Jun Yang @ 2009-12-14 10:47 UTC (permalink / raw)
  To: ocfs2-devel

Hi, Joel,

The attached patch is the first version about extent stealing. Please 
feel free to correct me about the codes or function name or comments.

thanks,
tiger
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0001-ocfs2-add-extent-block-stealing-for-ocfs2.patch
Url: http://oss.oracle.com/pipermail/ocfs2-devel/attachments/20091214/aa26e168/attachment.pl 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Ocfs2-devel] ocfs2: add extent block stealing for ocfs2 v1
  2009-12-14 10:47 [Ocfs2-devel] ocfs2: add extent block stealing for ocfs2 v1 Jun Yang
@ 2009-12-15  8:04 ` Tao Ma
  2009-12-17  9:48   ` Jun Yang
  0 siblings, 1 reply; 4+ messages in thread
From: Tao Ma @ 2009-12-15  8:04 UTC (permalink / raw)
  To: ocfs2-devel

Hi Tiger,

@@ -731,36 +715,39 @@ int ocfs2_reserve_new_inode(struct ocfs2_super *osb,
 		goto bail;
 	}
 
-	(*ac)->ac_bits_wanted = 1;
-	(*ac)->ac_which = OCFS2_AC_USE_INODE;
-
+	(*ac)->ac_bits_wanted = blocks;
 	(*ac)->ac_group_search = ocfs2_block_group_search;
+	if (type == INODE_ALLOC_SYSTEM_INODE)
+		(*ac)->ac_which = OCFS2_AC_USE_INODE;
+	else if (type == EXTENT_ALLOC_SYSTEM_INODE)
+		(*ac)->ac_which = OCFS2_AC_USE_META;
 
 	/*
 	 * stat(2) can't handle i_ino > 32bits, so we tell the
 	 * lower levels not to allocate us a block group past that
 	 * limit.  The 'inode64' mount option avoids this behavior.
 	 */
-	if (!(osb->s_mount_opt & OCFS2_MOUNT_INODE64))
+	if (type == INODE_ALLOC_SYSTEM_INODE &&
+	    !(osb->s_mount_opt & OCFS2_MOUNT_INODE64))
 		(*ac)->ac_max_block = (u32)~0U;
 
 	/*
-	 * slot is set when we successfully steal inode from other nodes.
-	 * It is reset in 3 places:
+	 * slot is set when we successfully steal inode/extent
+	 * from other nodes. It is reset in 3 places:
 	 * 1. when we flush the truncate log
 	 * 2. when we complete local alloc recovery.
 	 * 3. when we successfully allocate from our own slot.
-	 * After it is set, we will go on stealing inodes until we find the
+	 * After it is set, we will go on stealing resource until we find the
 	 * need to check our slots to see whether there is some space for us.
 	 */
 	if (slot != OCFS2_INVALID_SLOT &&
-	    atomic_read(&osb->s_num_inodes_stolen) < OCFS2_MAX_INODES_TO_STEAL)
-		goto inode_steal;
+	    ocfs2_could_steal_resource(osb, type))
+		goto resource_steal;
 
-	atomic_set(&osb->s_num_inodes_stolen, 0);
+	ATOMIC_ZERO_RESOURCE_NUMBER(type);
 	alloc_group = osb->osb_inode_alloc_group;
here, you use the alloc_group which is only used in inode alloc and reset it
after the reservation succeed. I am afraid extent alloc shouldn't use and
change it?

 	status = ocfs2_reserve_suballoc_bits(osb, *ac,
-					     INODE_ALLOC_SYSTEM_INODE,
+					     type,
 					     osb->slot_num,
 					     &alloc_group,
 					     ALLOC_NEW_GROUP |


    I am also curious about one thing. Have you written the test script 
for it to see whether it works?
You can take ocfs2-tests/programs/inode_stealing/inode_stealing.sh for 
reference.

Regards,
Tao

Jun Yang wrote:
> Hi, Joel,
>
> The attached patch is the first version about extent stealing. Please 
> feel free to correct me about the codes or function name or comments.
>
> thanks,
> tiger
> ------------------------------------------------------------------------
>
> _______________________________________________
> Ocfs2-devel mailing list
> Ocfs2-devel at oss.oracle.com
> http://oss.oracle.com/mailman/listinfo/ocfs2-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Ocfs2-devel] ocfs2: add extent block stealing for ocfs2 v1
  2009-12-15  8:04 ` Tao Ma
@ 2009-12-17  9:48   ` Jun Yang
  2009-12-17 14:00     ` Tao Ma
  0 siblings, 1 reply; 4+ messages in thread
From: Jun Yang @ 2009-12-17  9:48 UTC (permalink / raw)
  To: ocfs2-devel

On 12/15/2009 04:04 PM, Tao Ma wrote:
> alloc_group = osb->osb_inode_alloc_group;
> here, you use the alloc_group which is only used in inode alloc and
> reset it
> after the reservation succeed. I am afraid extent alloc shouldn't use and
> change it?
Yes, It's a mistake. It seems I would better not merge those two functions.

> I am also curious about one thing. Have you written the test script for
> it to see whether it works?
> You can take ocfs2-tests/programs/inode_stealing/inode_stealing.sh for
> reference.
thanks for your advice. I will make a similar test for extent block 
stealing patches.

Thanks,
tiger

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Ocfs2-devel] ocfs2: add extent block stealing for ocfs2 v1
  2009-12-17  9:48   ` Jun Yang
@ 2009-12-17 14:00     ` Tao Ma
  0 siblings, 0 replies; 4+ messages in thread
From: Tao Ma @ 2009-12-17 14:00 UTC (permalink / raw)
  To: ocfs2-devel

Jun Yang wrote:
> On 12/15/2009 04:04 PM, Tao Ma wrote:
>> alloc_group = osb->osb_inode_alloc_group;
>> here, you use the alloc_group which is only used in inode alloc and
>> reset it
>> after the reservation succeed. I am afraid extent alloc shouldn't use 
>> and
>> change it?
> Yes, It's a mistake. It seems I would better not merge those two 
> functions.
oh, you can merge them. Just make sure not mess extent_alloc with 
inode_alloc.
>
>> I am also curious about one thing. Have you written the test script for
>> it to see whether it works?
>> You can take ocfs2-tests/programs/inode_stealing/inode_stealing.sh for
>> reference.
> thanks for your advice. I will make a similar test for extent block 
> stealing patches.
cool.

Regards,
Tao

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-12-17 14:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-14 10:47 [Ocfs2-devel] ocfs2: add extent block stealing for ocfs2 v1 Jun Yang
2009-12-15  8:04 ` Tao Ma
2009-12-17  9:48   ` Jun Yang
2009-12-17 14:00     ` Tao Ma

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.