From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [59.151.112.132] (helo=heian.cn.fujitsu.com) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Z2Brk-0003L8-MY for linux-mtd@lists.infradead.org; Tue, 09 Jun 2015 05:14:25 +0000 Message-ID: <557674F5.1060405@cn.fujitsu.com> Date: Tue, 9 Jun 2015 13:09:09 +0800 From: Dongsheng Yang MIME-Version: 1.0 To: Richard Weinberger , , , Subject: Re: [PATCH RESEND] ubifs: Introduce a mount option of force_atime. References: <1433758060-18614-1-git-send-email-yangds.fnst@cn.fujitsu.com> <55761D51.7000005@nod.at> <55765C65.80302@cn.fujitsu.com> <557672FF.8080407@cn.fujitsu.com> In-Reply-To: <557672FF.8080407@cn.fujitsu.com> Content-Type: text/plain; charset="ISO-8859-15"; format=flowed Content-Transfer-Encoding: 7bit Cc: linux-fsdevel@vger.kernel.org List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On 06/09/2015 01:00 PM, Dongsheng Yang wrote: > On 06/09/2015 11:24 AM, Dongsheng Yang wrote: >> On 06/09/2015 06:55 AM, Richard Weinberger wrote: >>> Am 08.06.2015 um 12:07 schrieb Dongsheng Yang: >>>> - ubifs_assert(mutex_is_locked(&ui->ui_mutex)); >>>> if (!ui->dirty) { >>>> + if (!locked) { >>>> + /* >>>> + * It's a little tricky here, there is only one >>>> + * possible user of ubifs_dirty_inode did not do >>>> + * a budget for this inode. At the same time, this >>>> + * user is not holding the ui->ui_mutex. Then if >>>> + * we found ui->ui_mutex is not locked, we can say: >>>> + * we need to do a budget in ubifs_dirty_inode here. >>>> + */ >>>> + struct ubifs_budget_req req = { .dirtied_ino = 1, >>>> + .dirtied_ino_d = ALIGN(ui->data_len, 8) }; >>>> + >>>> + ret = ubifs_budget_space(c, &req); >>>> + if (ret) >>>> + goto out; >>>> + } >>> >>> So, this is the new case when ->dirty_inode() is called via >>> generic_update_time()? >>> Did you research whether you can detect that case also by looking at >>> the flags parameter? >>> I'd give I_DIRTY_TIME a try. This way you could get at least rid of >>> the mutex_is_locked() >>> usage. >> >> Okey, after a reading, I'm afraid I can not think a better idea >> out. The flags between *old* cases and the *new* case can possiblly >> be same. Then we can't use the flags to filter the new case from old >> cases. > > Oops, sorry, my bad!! > > generic_upadte_time() is the only way to use I_DIRTY_TIME here currently. But there is another problem, if we are going to try to support lazytime, we have to set the I_DIRTY_TIME in the *old* cases. Then we can not use the flags to distinguish them in drity_inode(). > You are right!. we can get rid of mutex_is_locked() at least. > > Thanx > Yang >> >> But I think I can append a patch to add a support for lazytime here: >> if (flags == I_DIRTY_TIME) >> return; >> >> Thanx >> Yang >> >>> >>> Thanks, >>> //richard >>> . >>> >> >> -- >> To unsubscribe from this list: send the line "unsubscribe >> linux-fsdevel" in >> the body of a message to majordomo@vger.kernel.org >> More majordomo info at http://vger.kernel.org/majordomo-info.html >> . >> > > -- > To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > . > From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dongsheng Yang Subject: Re: [PATCH RESEND] ubifs: Introduce a mount option of force_atime. Date: Tue, 9 Jun 2015 13:09:09 +0800 Message-ID: <557674F5.1060405@cn.fujitsu.com> References: <1433758060-18614-1-git-send-email-yangds.fnst@cn.fujitsu.com> <55761D51.7000005@nod.at> <55765C65.80302@cn.fujitsu.com> <557672FF.8080407@cn.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-15"; format=flowed Content-Transfer-Encoding: 7bit Cc: To: Richard Weinberger , , , Return-path: Received: from cn.fujitsu.com ([59.151.112.132]:46121 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1751896AbbFIFOH (ORCPT ); Tue, 9 Jun 2015 01:14:07 -0400 In-Reply-To: <557672FF.8080407@cn.fujitsu.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On 06/09/2015 01:00 PM, Dongsheng Yang wrote: > On 06/09/2015 11:24 AM, Dongsheng Yang wrote: >> On 06/09/2015 06:55 AM, Richard Weinberger wrote: >>> Am 08.06.2015 um 12:07 schrieb Dongsheng Yang: >>>> - ubifs_assert(mutex_is_locked(&ui->ui_mutex)); >>>> if (!ui->dirty) { >>>> + if (!locked) { >>>> + /* >>>> + * It's a little tricky here, there is only one >>>> + * possible user of ubifs_dirty_inode did not do >>>> + * a budget for this inode. At the same time, this >>>> + * user is not holding the ui->ui_mutex. Then if >>>> + * we found ui->ui_mutex is not locked, we can say: >>>> + * we need to do a budget in ubifs_dirty_inode here. >>>> + */ >>>> + struct ubifs_budget_req req = { .dirtied_ino = 1, >>>> + .dirtied_ino_d = ALIGN(ui->data_len, 8) }; >>>> + >>>> + ret = ubifs_budget_space(c, &req); >>>> + if (ret) >>>> + goto out; >>>> + } >>> >>> So, this is the new case when ->dirty_inode() is called via >>> generic_update_time()? >>> Did you research whether you can detect that case also by looking at >>> the flags parameter? >>> I'd give I_DIRTY_TIME a try. This way you could get at least rid of >>> the mutex_is_locked() >>> usage. >> >> Okey, after a reading, I'm afraid I can not think a better idea >> out. The flags between *old* cases and the *new* case can possiblly >> be same. Then we can't use the flags to filter the new case from old >> cases. > > Oops, sorry, my bad!! > > generic_upadte_time() is the only way to use I_DIRTY_TIME here currently. But there is another problem, if we are going to try to support lazytime, we have to set the I_DIRTY_TIME in the *old* cases. Then we can not use the flags to distinguish them in drity_inode(). > You are right!. we can get rid of mutex_is_locked() at least. > > Thanx > Yang >> >> But I think I can append a patch to add a support for lazytime here: >> if (flags == I_DIRTY_TIME) >> return; >> >> Thanx >> Yang >> >>> >>> Thanks, >>> //richard >>> . >>> >> >> -- >> To unsubscribe from this list: send the line "unsubscribe >> linux-fsdevel" in >> the body of a message to majordomo@vger.kernel.org >> More majordomo info at http://vger.kernel.org/majordomo-info.html >> . >> > > -- > To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > . >