Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9812BC7EE23 for ; Fri, 24 Feb 2023 17:20:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229584AbjBXRU1 (ORCPT ); Fri, 24 Feb 2023 12:20:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48956 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229610AbjBXRUY (ORCPT ); Fri, 24 Feb 2023 12:20:24 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9CFA01589B for ; Fri, 24 Feb 2023 09:19:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1677259176; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=f2WOQUqLPxDcFQ7Nje15yiuLa01CXfpErjUcBxi/r80=; b=AIlcp31y0GteEwcxJdjqnYdu/cVeFUQd8MGZ3XqivK5aAsLE/2nZc5puyjjeU/jeqweJpj n3IWkg/IxvPiOmF9mRccdvQTmV88HmoW3ZJljp1zwCROM8UCdGCl9Q5HvSH1vRcBoiHV6s VaVe7Db3+KGM+V4Ig25dDIKM19mzZio= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-593-NifuMESHMPOwiyBH2L3mAQ-1; Fri, 24 Feb 2023 12:19:31 -0500 X-MC-Unique: NifuMESHMPOwiyBH2L3mAQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4C0DD3804531; Fri, 24 Feb 2023 17:19:30 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.33.36.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id C6C722026D4B; Fri, 24 Feb 2023 17:19:28 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: References: <2009825.1677229488@warthog.procyon.org.uk> <20230220135225.91b0f28344c01d5306c31230@linux-foundation.org> <2134430.1677240738@warthog.procyon.org.uk> <2213409.1677249075@warthog.procyon.org.uk> To: Linus Torvalds Cc: dhowells@redhat.com, Steve French , Vishal Moola , Andrew Morton , Jan Kara , Paulo Alcantara , Matthew Wilcox , Huang Ying , Baolin Wang , Xin Hao , linux-mm@kvack.org, mm-commits@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC][PATCH] cifs: Fix cifs_writepages_region() MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2385283.1677259167.1@warthog.procyon.org.uk> Date: Fri, 24 Feb 2023 17:19:27 +0000 Message-ID: <2385284.1677259167@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Linus Torvalds wrote: > Can you humor me, and try if just removing that skip count thing > instead? IOW, this attached patch? That works too. > Because that whole "let's stop writing if we need to reschedule" sounds > truly odd (we have a cond_resched(), although it's per folio batch, not > per-folio), and the skip count logic doesn't make much sense to me either. The skip thing, in my code, is only used in WB_SYNC_NONE mode. If we hit 5 things in progress or rescheduling is required, we return to the caller on the basis that conflicting flushes appear to be happening in other threads. David