From patchwork Tue Oct 3 10:05:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Hans Holmberg X-Patchwork-Id: 9982089 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D249760365 for ; Tue, 3 Oct 2017 10:06:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CC350201B1 for ; Tue, 3 Oct 2017 10:06:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C0DA92888B; Tue, 3 Oct 2017 10:06:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6FAF5201B1 for ; Tue, 3 Oct 2017 10:06:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751883AbdJCKG4 (ORCPT ); Tue, 3 Oct 2017 06:06:56 -0400 Received: from mail-wm0-f50.google.com ([74.125.82.50]:48263 "EHLO mail-wm0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751736AbdJCKGx (ORCPT ); Tue, 3 Oct 2017 06:06:53 -0400 Received: by mail-wm0-f50.google.com with SMTP id i82so13415537wmd.3 for ; Tue, 03 Oct 2017 03:06:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=owltronix-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ub12HGChAqVB4PAY64oVA8a3FMeqxN4vbl7ZxwPHPA0=; b=EzNIUDo5dUyZkPyut/nJ8Mt829qKqI2Ga9jAskBfqysA2O1qFb7ko+ZahlYousy7ta xSQLtoYDrYRhSv12DFltEsrPZFDr24qkvcqh4qvDRpqfR0bAbfsG7tt/iotY7w0C31SF AwzcgB0UQGrLgD8k2d02hkxvk8krByO/OP5TpMnL7gjbyzRnCT+hFiyH4lcwjYTaU6cK S3Ea+zonfh9IG9osokoc6x5qqzFOM1DQQb/m6jQowTFXOvPx3F4S0PSshbZDqHuXBAKn yUU15Vw4nDaudswgCt+NiBNtm/TjpIASMEQKJ+6YuCHsD1PglcC9mz1b5ZnBbpcFdG63 UCjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ub12HGChAqVB4PAY64oVA8a3FMeqxN4vbl7ZxwPHPA0=; b=WMCfq55Rs3gOTNeBlcqMa8cb5U2V9rSmXK6VQZZvuPQwif4EhaV1Puk0mYpj+IM8oN RKxrOXAupt2MhQoJKi9LmeE1MeR41vz31cw8mWsJVZ1HifR96ekPjXgzge/f/9Xxnw6e rmu6W4DHs4nfjvbIBqNg+1eETi6EmPYdPIodliwHzWcyRjw1VuJRPZVdCdBc/XG0/F1S yBqTrpPTL4oMiW57yKMc2r9G3Ny3TGFqKQKP0F40UjscsafRye036mNyb1BbxmouGUlb groDsUQvJFHduW/cfkbhozew0bLJFJV0YrtLPxFeReW1DPOeUjeJziyAnEDdzKVuVkAv RnFA== X-Gm-Message-State: AHPjjUiFwl98QgGVBd3GNz8w3NuqkFHfhdTWh1/yWb2QpwWLimkKVC4s x+p5XKKluuZ325Dyho+5IiC8UA== X-Google-Smtp-Source: AOwi7QA1cC51x2KSZHAykE0buZAjJzo/rpw9hsPxcNwQjhB/VDD33X9BbJVADENqWNDAfq/Khcwwog== X-Received: by 10.80.142.216 with SMTP id x24mr23872034edx.285.1507025212752; Tue, 03 Oct 2017 03:06:52 -0700 (PDT) Received: from titan.cnexlabs.com (6164211-cl69.boa.fiberby.dk. [193.106.164.211]) by smtp.gmail.com with ESMTPSA id e50sm10594908ede.18.2017.10.03.03.06.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 03 Oct 2017 03:06:52 -0700 (PDT) From: Hans Holmberg To: Matias Bjorling Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Javier Gonzales , Hans Holmberg , Hans Holmberg Subject: [PATCH 4/9] lightnvm: pblk: start gc if needed during init Date: Tue, 3 Oct 2017 12:05:08 +0200 Message-Id: <1507025113-13351-5-git-send-email-hans.ml.holmberg@owltronix.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1507025113-13351-1-git-send-email-hans.ml.holmberg@owltronix.com> References: <1507025113-13351-1-git-send-email-hans.ml.holmberg@owltronix.com> Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Hans Holmberg Start GC, if needed, directly after init, as we might need to garbage collect to make room for user writes. Signed-off-by: Hans Holmberg Reviewed-by: Javier González --- drivers/lightnvm/pblk-init.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/lightnvm/pblk-init.c b/drivers/lightnvm/pblk-init.c index 1cc3de4..fb41182 100644 --- a/drivers/lightnvm/pblk-init.c +++ b/drivers/lightnvm/pblk-init.c @@ -1022,6 +1022,10 @@ static void *pblk_init(struct nvm_tgt_dev *dev, struct gendisk *tdisk, pblk->rwb.nr_entries); wake_up_process(pblk->writer_ts); + + /* Check if we need to start GC */ + pblk_gc_should_kick(pblk); + return pblk; fail_stop_writer: