From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751407AbdHYEC2 (ORCPT ); Fri, 25 Aug 2017 00:02:28 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:58452 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750724AbdHYEC1 (ORCPT ); Fri, 25 Aug 2017 00:02:27 -0400 Subject: Re: [PATCH] xfs: Drop setting redundant PF_KSWAPD in kswapd context To: Dave Chinner , Michal Hocko References: <20170824104247.8288-1-khandual@linux.vnet.ibm.com> <20170824105635.GA5965@dhcp22.suse.cz> <20170825000137.GI21024@dastard> Cc: Anshuman Khandual , linux-mm@kvack.org, linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org, dchinner@redhat.com, bfoster@redhat.com, sandeen@sandeen.net From: Anshuman Khandual Date: Fri, 25 Aug 2017 09:32:14 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <20170825000137.GI21024@dastard> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-TM-AS-MML: disable x-cbid: 17082504-1617-0000-0000-000001FC9FC1 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17082504-1618-0000-0000-00004848C2E1 Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-08-25_02:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1708250059 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/25/2017 05:31 AM, Dave Chinner wrote: > On Thu, Aug 24, 2017 at 12:56:35PM +0200, Michal Hocko wrote: >> On Thu 24-08-17 16:12:47, Anshuman Khandual wrote: >>> xfs_btree_split() calls xfs_btree_split_worker() with args.kswapd set >>> if current->flags alrady has PF_KSWAPD. Hence we should not again add >>> PF_KSWAPD into the current flags inside kswapd context. So drop this >>> redundant flag addition. >> >> I am not familiar with the code but your change seems incorect. The >> whole point of args->kswapd is to convey the kswapd context to the >> worker which is obviously running in a different context. So this patch >> loses the kswapd context. > > Yup. That's what the code does, and removing the PF_KSWAPD from it > will break it. The worker thread need to inherit these flags. Thanks for pointing out.